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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]