Re: [PATCH] virsh: Print error message if argument parsing fails for cmdNodesuspend

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

 



On 13.12.2011 14:53, Peter Krempa wrote:
> If parsing of arguments failed, virsh did silently exit returning and
> error state, but not specifying the possible problem.
> 
>  * tools/virsh: cmdNodesuspend: - error handling added
> ---
>  tools/virsh.c |   12 +++++++++---
>  1 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index d58b827..ebda248 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -5270,14 +5270,20 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd)
>      if (!vshConnectionUsability(ctl, ctl->conn))
>          return false;
> 
> -    if (vshCommandOptString(cmd, "target", &target) < 0)
> +    if (vshCommandOptString(cmd, "target", &target) < 0) {
> +        vshError(ctl, _("Invalid suspend target argument"));
I'd do s/suspend // in all strings you're adding.

ACK with that nit fixed.

Michal

--
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]