[libvirt] [PATCH] vsh: Using vshError rather than virReportError

Peter Krempa pkrempa at redhat.com
Tue Oct 18 14:03:33 UTC 2016


On Tue, Oct 18, 2016 at 07:39:16 -0400, Kothapally Madhu Pavan wrote:
> Correcting the error reporting method by using vshError
> instead of virReportError
> 
> Signed-off-by: Kothapally Madhu Pavan <kmp at linux.vnet.ibm.com>
> ---
>  tools/virsh-domain.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 050e7fb..c9fabf2 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -10475,9 +10475,9 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd)
>  
>      if (vshCommandOptBool(cmd, "postcopy-after-precopy")) {
>          if (!vshCommandOptBool(cmd, "postcopy")) {
> -            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
> -                          _("--postcopy-after-precopy can only be used with "
> -                            "--postcopy"));
> +            vshError(ctl, "%s",
> +                     _("argument unsupported: --postcopy-after-precopy can only "
> +                       "be used with --postcopy"));
>              goto cleanup;

I think the above code can be avoided by simply using
VSH_REQUIRE_OPTION.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161018/2e034490/attachment-0001.sig>


More information about the libvir-list mailing list