[libvirt] [PATCH] virsh: fixing wrong datatype of 'set-lifcycle-action' command options.

Julio Faracco posted 1 patch 6 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1510801314-6602-1-git-send-email-jcfaracco@gmail.com
tools/virsh-domain.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[libvirt] [PATCH] virsh: fixing wrong datatype of 'set-lifcycle-action' command options.
Posted by Julio Faracco 6 years, 4 months ago
The 'set-lifcycle-action' is throwing a weird error after executing it with
the '--help' option. The command output is showing the options 'type' and
'action' are as optional, but they aren't. Both are required.

virsh # set-lifecycle-action --help
...
  SYNOPSIS
    set-lifecycle-action <domain> [--type <string>] [--action <string>] ...
...
  OPTIONS
    [--domain] <string>  domain name, id or uuid
error: internal error: bad options in command: 'set-lifecycle-action'

After applying this patch, both arguments are required now.

virsh # set-lifecycle-action --help
...
  SYNOPSIS
    set-lifecycle-action <domain> <type> <action> [--config] ...

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1509870

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
---
 tools/virsh-domain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 42d5526..bf96f2e 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -5532,12 +5532,12 @@ static const vshCmdInfo info_setLifecycleAction[] = {
 static const vshCmdOptDef opts_setLifecycleAction[] = {
     VIRSH_COMMON_OPT_DOMAIN_FULL,
     {.name = "type",
-     .type = VSH_OT_STRING,
+     .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
      .help = N_("lifecycle type to modify")
     },
     {.name = "action",
-     .type = VSH_OT_STRING,
+     .type = VSH_OT_DATA,
      .flags = VSH_OFLAG_REQ,
      .help = N_("lifecycle action to set")
     },
-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virsh: fixing wrong datatype of 'set-lifcycle-action' command options.
Posted by Michal Privoznik 6 years, 4 months ago
On 11/16/2017 04:01 AM, Julio Faracco wrote:
> The 'set-lifcycle-action' is throwing a weird error after executing it with
> the '--help' option. The command output is showing the options 'type' and
> 'action' are as optional, but they aren't. Both are required.
> 
> virsh # set-lifecycle-action --help
> ...
>   SYNOPSIS
>     set-lifecycle-action <domain> [--type <string>] [--action <string>] ...
> ...
>   OPTIONS
>     [--domain] <string>  domain name, id or uuid
> error: internal error: bad options in command: 'set-lifecycle-action'
> 
> After applying this patch, both arguments are required now.
> 
> virsh # set-lifecycle-action --help
> ...
>   SYNOPSIS
>     set-lifecycle-action <domain> <type> <action> [--config] ...
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1509870
> 
> Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
> ---
>  tools/virsh-domain.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

ACKed and pushed.

Michal

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