Bug 1509870 - Command "virsh set-lifecycle-action --help" raises abnormal error info
Summary: Command "virsh set-lifecycle-action --help" raises abnormal error info
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.5
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: jiyan
URL:
Whiteboard:
: 1577920 (view as bug list)
Depends On:
Blocks: 1507957 1513404 1577865
TreeView+ depends on / blocked
 
Reported: 2017-11-06 09:08 UTC by jiyan
Modified: 2019-07-02 05:18 UTC (History)
9 users (show)

Fixed In Version: libvirt-4.3.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 09:50:00 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3113 None None None 2018-10-30 09:51:23 UTC

Description jiyan 2017-11-06 09:08:04 UTC
Description of problem:
Command "virsh set-lifecycle-action --help" raises abnormal error info

Version-Release number of selected component (if applicable):
kernel-3.10.0-768.el7.x86_64
libvirt-3.9.0-1.el7.x86_64
qemu-kvm-rhev-2.10.0-4.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Run command 'virsh set-lifecycle-action --help'
# virsh set-lifecycle-action --help
  NAME
    set-lifecycle-action - change lifecycle actions

  SYNOPSIS
    set-lifecycle-action <domain> [--type <string>] [--action <string>] [--config] [--live] [--current]

  DESCRIPTION
    Change lifecycle actions for the guest domain.

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

Actual results:
As step 1 shows

Expected results:
Display command detailed info normally

Additional info:
When verifying #BZ1460677, this command can change lifecycle actions normally
Bug 1460677 - [RFE] Enable dynamic configuration of powercycle event actions

Comment 2 Michal Privoznik 2017-11-16 12:01:24 UTC
I've pushed the patch upstream:

commit c7543a7286b2480c3ef6791dd6eba35f1534dd12
Author:     Julio Faracco <jcfaracco@gmail.com>
AuthorDate: Thu Nov 16 01:01:54 2017 -0200
Commit:     Michal Privoznik <mprivozn@redhat.com>
CommitDate: Thu Nov 16 10:27:46 2017 +0100

    virsh: fixing wrong datatype of 'set-lifcycle-action' command options.
    
    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>

v3.9.0-137-gc7543a728

Comment 3 Jiri Denemark 2018-05-24 10:44:11 UTC
*** Bug 1577920 has been marked as a duplicate of this bug. ***

Comment 5 jiyan 2018-05-28 07:43:54 UTC
Verified this bug in libvirt-4.3.0-1.el7.x86_64

Version:
libvirt-4.3.0-1.el7.x86_64
qemu-kvm-rhev-2.10.0-21.el7_5.3.x86_64
kernel-3.10.0-893.el7.x86_64

Steps:
1. Run command 'virsh set-lifecycle-action --help'
# virsh set-lifecycle-action --help
  NAME
    set-lifecycle-action - change lifecycle actions

  SYNOPSIS
    set-lifecycle-action <domain> <type> <action> [--config] [--live] [--current]

  DESCRIPTION
    Change lifecycle actions for the guest domain.

  OPTIONS
    [--domain] <string>  domain name, id or uuid
    [--type] <string>  lifecycle type to modify
    [--action] <string>  lifecycle action to set
    --config         affect next boot
    --live           affect running domain
    --current        affect current domain

No error info raised.

The result is as expected, move this bug to be 'verified'.

Comment 7 errata-xmlrpc 2018-10-30 09:50:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:3113


Note You need to log in before you can comment on or make changes to this bug.