From ca71b87cb0c3810c97f1e5f2c1a469e708eadd0a Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 5 Dec 2007 16:24:22 +0000 Subject: [PATCH] Quit virsh immediately if connection open fails, rather than giving a non-functional interactive shell --- ChangeLog | 4 ++++ src/virsh.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d15a0d870f..9cecb0fd11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Dec 5 11:24:00 EST 2007 Daniel P. Berrange + + * src/virsh.c: quit if initial conection attempt fails + Wed Dec 5 10:29:00 EST 2007 Daniel P. Berrange * qemud/Makefile.am: Fix VPATH build for remote_generate_stubs.pl diff --git a/src/virsh.c b/src/virsh.c index 207a0ddc72..c6fc5deefd 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -4529,8 +4529,10 @@ vshInit(vshControl * ctl) * vshConnectionUsability, except ones which don't need a connection * such as "help". */ - if (!ctl->conn) + if (!ctl->conn) { vshError(ctl, FALSE, _("failed to connect to the hypervisor")); + return FALSE; + } return TRUE; }