[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

On Wed, Sep 10, 2008 at 02:12:29AM +0200, Johannes Formann wrote:
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?
No, that's a bug in the xend driver. I don't have a Xen machine to test against, but looking at the code I don't understand why the error message is printed but the code doesn't return -1 -- it seems like it should do. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top

Richard W.M. Jones <rjones@redhat.com> wrote:
On Wed, Sep 10, 2008 at 02:12:29AM +0200, Johannes Formann wrote:
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?
No, that's a bug in the xend driver. I don't have a Xen machine to test against, but looking at the code I don't understand why the error message is printed but the code doesn't return -1 -- it seems like it should do.
If I could help with some Information to debug the problem, just tell me how, and I'll try co collect the information. regards Johannes
participants (2)
-
Johannes Formann
-
Richard W.M. Jones