Re: [PATCH] virsh: Report errors if arguments of the schedinfo command are incorrect

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

 



On Mon, Dec 03, 2012 at 14:46:51 +0100, Peter Krempa wrote:
> Libvirt's helper API's when called directly don't raise the error so
> that virsh remembers it. Subsequent calls to libvirt API's might reset
> the error.
> 
> In case of schedinfo virDomainFree() in the cleanup section resets the
> error when virTypedParameterAssignFromStr() fails.
> 
> This patch adds function vshSaveLibvirtError() that can be called after
> calling libvirt helper APIs to ensure the error is remembered.
> ---
>  tools/virsh-domain.c | 8 ++++++--
>  tools/virsh.c        | 9 +++++++++
>  tools/virsh.h        | 1 +
>  3 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 73ebba9..1f7aff7 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -3512,8 +3512,10 @@ cmdSchedInfoUpdate(vshControl *ctl, const vshCmd *cmd,
>              if (virTypedParameterAssign(&(params[nparams++]),
>                                          param->field,
>                                          param->type,
> -                                        val) < 0)
> +                                        val) < 0) {
> +                vshSaveLibvirtError();
>                  goto cleanup;
> +            }
> 
>              continue;
>          }

Looks like there must be a lot of similar issues in other areas of virsh.

ACK,

Jirka

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