[libvirt] Having some issue with : virConnectRef

anuj rampal rampal.anuj at gmail.com
Mon Dec 14 06:18:22 UTC 2009


Im trying to call libvirt functions from a widows machine.

The client version i'm using is 0.6.1.

My application is a multi-Threaded application.

This is the way my application works:

1. I connect to Libvirt using "virConnectOpen". (this done only once when my
application starts).
2. For funther interaction with libvirt i just call "virConnectRef" and then
i call some other function like "virNodeGetInfo".
3. Then i call "virConnectClose".

Now my understanding is for every "virConnectRef" call there has to be a
corrosponding "virConnectClose".

In my application call to number of calls to "virConnectClose" is always
equal to "virConnectRef".
and "virConnectClose" corrosponding to "virConnectOpen" is called when the
application is closed.
So connection to libvirt should always be there till the time my application
is running.

But what is happening is, even if i call "virConnectRef" twice, a single
call to "virConnectClose" closes the connection with libvirt.

Is there anything that im doing wrong here...??

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20091214/5ab363a9/attachment-0001.htm>

More information about the libvir-list mailing list