Bug 869508 - the option --flags of virsh nodesuspend command should be removed
the option --flags of virsh nodesuspend command should be removed
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: Jiri Denemark
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-24 02:33 EDT by EricLee
Modified: 2013-02-21 02:10 EST (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0.10.2-6.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:10:56 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description EricLee 2012-10-24 02:33:01 EDT
Description
the option [--flags] of virsh nodesuspend command should give more explanation in manual

version
# rpm -qa libvirt qemu-kvm-rhev; uname -r
libvirt-0.10.2-4.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.317.el6.x86_64
2.6.32-330.el6.x86_64

reproduce
100%

Steps
1. # virsh help nodesuspend
  NAME
    nodesuspend - suspend the host node for a given time duration

  SYNOPSIS
    nodesuspend <target> <duration> [--flags <number>]

  DESCRIPTION
    Suspend the host node for a given time duration and attempt to resume thereafter.

  OPTIONS
    [--target] <string>  mem(Suspend-to-RAM), disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)
    [--duration] <number>  Suspend duration in seconds, at least 60
    --flags <number>  Suspend flags, 0 for default

2. # man virsh
.....
       nodesuspend [target] [duration] [flags]
           Puts the node (host machine) into a system-wide sleep state such as Suspend-to-RAM, Suspend-to-
           Disk or Hybrid-Suspend and sets up a Real-Time-Clock interrupt to fire (to wake up the node)
           after a time delay specified by the ’duration’ parameter. The duration time should be at least 60
           seconds.
.....

There is no more explanation for "--flags", for example, if other values except 0 work, or how does it work, what's the different between giving or not?

And there is no info for this in libvirt.org.

Actual result
As steps

Expect result
Give more explanation for it, for example, if other values except 0 work, or how does it work, what's the different between giving or not?
Comment 2 Dave Allan 2012-10-24 09:44:28 EDT
After discussion with Jiri and Eric on irc, consensus is that the flags option should be removed and replaced with human understandable options for any applicable flags.  Jiri, Eric, any thoughts?
Comment 3 Eric Blake 2012-10-24 09:48:08 EDT
In the current code base, there ARE no flags - the only thing you can pass that does not cause failure is '--flags 0', but that's the default.  The addition of the --flags argument in virsh was a mistake, and removing it makes sense.
Comment 4 Jiri Denemark 2012-10-26 07:52:53 EDT
Fixed upstream by v1.0.0-rc1-17-gab54581:

commit ab54581549667af43b2bef493c696633d46031ff
Author: Jiri Denemark <jdenemar@redhat.com>
Date:   Thu Oct 25 10:14:38 2012 +0200

    virsh: Remove --flags from nodesuspend
    
    We always expose individual bits from flags as separate options rather
    than exposing a raw flags options. Since virNodeSuspendForDuration does
    not currently support any flags, the only way of using this --flags
    options that would not fail is "--flags 0", which is equivalent to
    omitting the option. Thus it is highly unlikely anyone would actually be
    using it and removing it should be safe.
Comment 6 yuping zhang 2012-10-30 01:52:57 EDT
Verified this issue with libvirt-0.10.2-6.el6.x86_64.

# virsh help nodesuspend
  NAME
    nodesuspend - suspend the host node for a given time duration

  SYNOPSIS
    nodesuspend <target> <duration>

  DESCRIPTION
    Suspend the host node for a given time duration and attempt to resume thereafter.

  OPTIONS
    [--target] <string>  mem(Suspend-to-RAM), disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)
    [--duration] <number>  Suspend duration in seconds, at least 60

#man virsh
....
 nodesuspend [target] [duration]
           Puts the node (host machine) into a system-wide sleep state such as Suspend-to-RAM,
           Suspend-to-Disk or Hybrid-Suspend 
...

# virsh nodesuspend --target mem 61 --flags 0
error: command 'nodesuspend' doesn't support option --flags
Comment 8 yuping zhang 2012-10-30 03:20:33 EDT
Change the bug status to VERIFIED as comment 6.
Comment 9 errata-xmlrpc 2013-02-21 02:10:56 EST
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.

http://rhn.redhat.com/errata/RHSA-2013-0276.html

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