summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-12-23 12:15:48 +0100
committerGuido Günther <agx@sigxcpu.org>2012-12-23 12:15:48 +0100
commite72245657ff92f2c6671fe33ee607cd1a93aba31 (patch)
tree342c89561206b8fb932269de94d7b6d68b613842 /tools
parent751c235722d4e5b4a3dcbe485011ee1d13480d7b (diff)
New upstream version 1.0.1
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile.in1
-rw-r--r--tools/virsh.c11
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/Makefile.in b/tools/Makefile.in
index c6cb5ae89..c4124497f 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -208,6 +208,7 @@ am__aclocal_m4_deps = $(top_srcdir)/gnulib/m4/00gnulib.m4 \
$(top_srcdir)/gnulib/m4/servent.m4 \
$(top_srcdir)/gnulib/m4/setenv.m4 \
$(top_srcdir)/gnulib/m4/setlocale.m4 \
+ $(top_srcdir)/gnulib/m4/sha256.m4 \
$(top_srcdir)/gnulib/m4/sig_atomic_t.m4 \
$(top_srcdir)/gnulib/m4/sigaction.m4 \
$(top_srcdir)/gnulib/m4/signal_h.m4 \
diff --git a/tools/virsh.c b/tools/virsh.c
index b4829a34d..465cb444e 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -331,7 +331,10 @@ vshReconnect(vshControl *ctl)
virConnectAuthPtrDefault,
ctl->readonly ? VIR_CONNECT_RO : 0);
if (!ctl->conn) {
- vshError(ctl, "%s", _("Failed to reconnect to the hypervisor"));
+ if (disconnected)
+ vshError(ctl, "%s", _("Failed to reconnect to the hypervisor"));
+ else
+ vshError(ctl, "%s", _("failed to connect to the hypervisor"));
} else {
if (virConnectRegisterCloseCallback(ctl->conn, vshCatchDisconnect,
NULL, NULL) < 0)
@@ -2186,10 +2189,7 @@ vshInit(vshControl *ctl)
ctl->eventLoopStarted = true;
if (ctl->name) {
- ctl->conn = virConnectOpenAuth(ctl->name,
- virConnectAuthPtrDefault,
- ctl->readonly ? VIR_CONNECT_RO : 0);
-
+ vshReconnect(ctl);
/* Connecting to a named connection must succeed, but we delay
* connecting to the default connection until we need it
* (since the first command might be 'connect' which allows a
@@ -2198,7 +2198,6 @@ vshInit(vshControl *ctl)
*/
if (!ctl->conn) {
vshReportError(ctl);
- vshError(ctl, "%s", _("failed to connect to the hypervisor"));
return false;
}
}