]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Pass ctl to virshCatchDisconnect
authorJiri Denemark <jdenemar@redhat.com>
Thu, 17 Dec 2015 22:23:01 +0000 (23:23 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 7 Jan 2016 21:21:09 +0000 (22:21 +0100)
virshCatchDisconnect expects ctl, but we were just passing NULL instead.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
tools/virsh.c

index 7484bed8ebd55b6c3b0bf144119ba9ed026aa731..2b53bf7be9d414f418ee94f748197769306cd06b 100644 (file)
@@ -207,7 +207,7 @@ virshReconnect(vshControl *ctl)
             vshError(ctl, "%s", _("failed to connect to the hypervisor"));
     } else {
         if (virConnectRegisterCloseCallback(priv->conn, virshCatchDisconnect,
-                                            NULL, NULL) < 0)
+                                            ctl, NULL) < 0)
             vshError(ctl, "%s", _("Unable to register disconnect callback"));
         if (connected)
             vshError(ctl, "%s", _("Reconnected to the hypervisor"));
@@ -294,7 +294,7 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
     }
 
     if (virConnectRegisterCloseCallback(priv->conn, virshCatchDisconnect,
-                                        NULL, NULL) < 0)
+                                        ctl, NULL) < 0)
         vshError(ctl, "%s", _("Unable to register disconnect callback"));
 
     return true;