Re: Status of Host machine.

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

 



On 13.06.2014 11:35, Sijo Jose wrote:
Hi Michal,

virConnectOpen is for connecting to a host right..?

I want to check the host status, whether the connection to the host is
active or not..
for that purpose we have to use virConnectIsAlive()

I'm using libvirt python bindings,
here is the function defnintion.

     def isAlive(self):
         """Determine if the connection to the hypervisor is still alive
         A connection will be classed as alive if it is either local, or
running
         over a channel (TCP or UNIX socket) which is not closed. """
         ret = libvirtmod.virConnectIsAlive(self._o)
         if ret == -1: raise libvirtError ('virConnectIsAlive() failed',
conn=self)
         return ret

Once if you connect to a host thereafter it is always giving status as
1(true), no matter whether the connection is broken or not..

You need to use recent libvirt which added keep-alive support (last stable version is 1.2.1 or newer) and then have a separate thread to run the event loop. Once you have all of these, isAlive() should work just fine.

Michal

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users




[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux