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..
-Sijo