[Libvir] problem with virConnectClose in libvirt 0.1.5

Philippe Berthault Philippe.Berthault at Bull.net
Wed Sep 20 15:50:59 UTC 2006


After closing libvirt with virConnectClose, it's possible to open 
libvirt again in the same program with virConnectOpen but following 
operations on domains systematically fail.

In example:

conn = virConnectOpen(NULL);
dom = virDomainLookupByID(conn, id);
virDomainFree(dom);
virConnectClose(conn);
...
conn = virConnectOpen(NULL);
dom = virDomainLookupByID(conn, id);
==> ERROR

The second virDomainLookupByID call fails because of the do_connect() 
function in xend_internal.c source file. In this function, the connect() 
API returns ENOENT on the second virDomainLookupByID() call.

ENOENT return code isn't documented in the man of connect API !

I suppose that some cleaning are missing when virConnectClose is called 
or in the opposite, too cleaning is done.

Regards.





More information about the libvir-list mailing list