[Libvir] [PATCH] Fix pathological behaviour of "virsh help" (was: Re: RFC: replace "no support for hypervisor" error)

Richard W.M. Jones rjones at redhat.com
Wed Jun 20 11:25:17 UTC 2007


Daniel Veillard wrote:
>     - if our default behaviour was a bit less pathological
> 
>    virsh: error: failed to connect to the hypervisor
>    paphio:~/libvirt -> virsh help
>    libvir: error : operation failed: xenProxyOpen
>    virsh: error: failed to connect to the hypervisor

This patch fixes the pathological failure of 'virsh help command'.

(1) We allow ctl->conn to be NULL, meaning "no connection".

(2) All cmd* functions check vshConnectionUsability where required (I 
checked this) except the ones which don't need to such as cmdHelp.

(3) vshInit has changed so that not being able to connect to a 
hypervisor is a non-fatal condition.  Thus after vshInit, ctl->conn may 
be NULL.

(4) I reordered the list of commands alphabetically, except that "help" 
is listed first.

$ virsh help save
libvir: error : operation failed: xenProxyOpen
error: failed to connect to the hypervisor
   NAME
     save - save a domain state to a file

   SYNOPSIS
     save <domain> <file>

   DESCRIPTION
     Save a running domain.

   OPTIONS
     <domain>         domain name, id or uuid
     <file>           where to save the data


Rich.

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-virsh-help-20070620.patch
Type: text/x-patch
Size: 3623 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070620/bf32d8db/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070620/bf32d8db/attachment-0003.bin>


More information about the libvir-list mailing list