]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: Improve checking for connection when running commands
authorPeter Krempa <pkrempa@redhat.com>
Fri, 24 Aug 2012 10:39:53 +0000 (12:39 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 31 Aug 2012 14:22:22 +0000 (16:22 +0200)
commit70e608918ebf4251ee7124184a0512b968a80035
tree16f87d9d5c3178a4fc06ebc21d1df4002629050d
parentb805e3428e0033657ed84bbdec3e428d096405af
virsh: Improve checking for connection when running commands

Almost each virsh command uses the function vshConnectionUsability
before doing anything, to check if the connection is "alive".  Commands
that don't need an conection are already conveniently marked with
VSH_CMD_FLAG_NOCONNECT. We can automaticaly check for the connection
before calling any remote command so we don't forget to do so.

This patch also upgrades the connection check to use virConnectIsAlive
along with the current approach.
tools/virsh.c