Red Hat Bugzilla – Bug 869508
the option --flags of virsh nodesuspend command should be removed
Last modified: 2013-02-21 02:10:56 EST
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?
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?
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.
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.
In POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-October/msg01187.html
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
Change the bug status to VERIFIED as comment 6.
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