[libvirt] [PATCH RFCv2 5/5] virsh: Reconnect to daemon if remote netcat crashes while using libssh

Peter Krempa pkrempa at redhat.com
Tue Jan 3 23:47:41 UTC 2012


This patch enables reconnection if for some reason remote netcat, that
is connecting libvirt daemon to the ssh transport layer crashes.

* tools/virsh.c: Add support for Libssh's error code
---
 tools/virsh.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 0bc0519..682251c 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -17048,7 +17048,8 @@ vshCommandRun(vshControl *ctl, const vshCmd *cmd)
                (last_error->domain == VIR_FROM_REMOTE)) ||
               (last_error->code == VIR_ERR_RPC) ||
               (last_error->code == VIR_ERR_NO_CONNECT) ||
-              (last_error->code == VIR_ERR_INVALID_CONN))))
+              (last_error->code == VIR_ERR_INVALID_CONN) ||
+              (last_error->code == VIR_ERR_LIBSSH_REMOTE_COMMAND))))
             disconnected++;

         if (!ret)
-- 
1.7.3.4




More information about the libvir-list mailing list