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

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



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


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