[libvirt] virDomainGetInfo() returns 0 although the domain is not running anymore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

if I understand the API-documentation, virDomainGetInfo() should return
-1 when the domain does not exists anymore, or some other problem
happens.

But with this code below
...
if (virDomainGetInfo(domainPtr,domainInfo) == 0 ) {
        if (debugLevel > 15) {puts("virDomainGetInfo() returns 0");}
        if (domainInfo->state == VIR_DOMAIN_NOSTATE ||
                domainInfo->state == VIR_DOMAIN_RUNNING ||      
                domainInfo->state == VIR_DOMAIN_BLOCKED || 
                domainInfo->state == VIR_DOMAIN_PAUSED ) {
            return(false);
        }
   }
...

I notized, virDomainGetInfo() always returns zero, even if libvirt
prints an error.

If I destroy a domain (xm destroy) I'll get this Message with each call
of virDomainGetInfo(): 
"libvir: Xen Daemon error : GET operation failed:"

But virDomainGetInfo() still returns zero, a bug, or did I
missunderstood the API?


regards

Johannes

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]