Package org.libvirt.DomainInfo

Examples of org.libvirt.DomainInfo.DomainState


    }

    public int domainDelete(String domainName) throws LibvirtException {
        Domain domain = getDomain(domainName);
        try {
            DomainState state = domain.getInfo().state;
   
            if ((state != DomainState.VIR_DOMAIN_SHUTDOWN) && (state != DomainState.VIR_DOMAIN_SHUTOFF)) {
                domain.destroy();
            }
            domain.undefine();
View Full Code Here


    }

    public AvailabilityType getAvailability() {
        try {
            LibVirtConnection virt = getConnection();
            DomainState state = virt.getDomainInfo(domainName).domainInfo.state;
            switch (state) {
            case VIR_DOMAIN_RUNNING:
                return AvailabilityType.UP;
            case VIR_DOMAIN_PAUSED:
                return AvailabilityType.UP;
View Full Code Here

TOP

Related Classes of org.libvirt.DomainInfo.DomainState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.