mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
admin: Introduce virAdmConnectIsAlive
Since most of our APIs rely on an acive functional connection to a daemon and we have such a mechanism in libvirt already, there's need to have such a way in libvirt-admin as well. By introducing a new public API, this patch provides support to check for an active connection.
This commit is contained in:
@@ -159,10 +159,10 @@ vshAdmConnectionHandler(vshControl *ctl)
|
||||
{
|
||||
vshAdmControlPtr priv = ctl->privData;
|
||||
|
||||
if (!priv->conn)
|
||||
if (!virAdmConnectIsAlive(priv->conn))
|
||||
vshAdmReconnect(ctl);
|
||||
|
||||
if (!priv->conn) {
|
||||
if (!virAdmConnectIsAlive(priv->conn)) {
|
||||
vshError(ctl, "%s", _("no valid connection"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user