Quit virsh immediately if connection open fails, rather than giving a non-functional interactive shell

This commit is contained in:
Daniel P. Berrange 2007-12-05 16:24:22 +00:00
parent cfb62c9d5e
commit ca71b87cb0
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,7 @@
Wed Dec 5 11:24:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/virsh.c: quit if initial conection attempt fails
Wed Dec 5 10:29:00 EST 2007 Daniel P. Berrange <berrange@redhat.com> Wed Dec 5 10:29:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* qemud/Makefile.am: Fix VPATH build for remote_generate_stubs.pl * qemud/Makefile.am: Fix VPATH build for remote_generate_stubs.pl

View File

@ -4529,8 +4529,10 @@ vshInit(vshControl * ctl)
* vshConnectionUsability, except ones which don't need a connection * vshConnectionUsability, except ones which don't need a connection
* such as "help". * such as "help".
*/ */
if (!ctl->conn) if (!ctl->conn) {
vshError(ctl, FALSE, _("failed to connect to the hypervisor")); vshError(ctl, FALSE, _("failed to connect to the hypervisor"));
return FALSE;
}
return TRUE; return TRUE;
} }