[libvirt] [PATCH] virsh: Insert error messages to avoid a quiet abortion of commands

Eric Blake eblake at redhat.com
Mon Mar 14 15:33:44 UTC 2011


On 03/14/2011 06:34 AM, Michal Privoznik wrote:
> in case of incorrect option parsing.
> ---
> My former patch introduced a regression:
> https://bugzilla.redhat.com/show_bug.cgi?id=605660
> 
>  tools/virsh.c |   52 ++++++++++++++++++++++++++++++++++++++--------------
>  1 files changed, 38 insertions(+), 14 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index b42aac4..42ebd55 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -706,8 +706,10 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
>      }
>  
>      VIR_FREE(ctl->name);
> -    if (vshCommandOptString(cmd, "name", &name) <= 0)
> +    if (vshCommandOptString(cmd, "name", &name) < 0) {
> +        vshError(ctl, "%s", _("Please specify valid connection URI"));
>          return FALSE;
> +    }

ACK, and sorry for not catching that on the first review.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110314/1be87105/attachment-0001.sig>


More information about the libvir-list mailing list