Bug 827380

Summary: Minimum value for nodesuspend time duration need be given in virsh manual or help
Product: Red Hat Enterprise Linux 6 Reporter: tingting zheng <tzheng>
Component: libvirtAssignee: Gunannan Ren <gren>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.3CC: acathrow, dallan, dyasny, dyuan, mzhan, rwu, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.10.0-0rc0.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:16:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description tingting zheng 2012-06-01 10:06:22 UTC
escription of problem:
Minimum value for nodesuspend time duration need be given in virsh manual or help

Version-Release number of selected component (if applicable):
libvirt-0.9.10-21.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.295.el6.x86_64


How reproducible:
100%

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

  SYNOPSIS
    nodesuspend   [--flags ]

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

  OPTIONS
    [--target]   mem(Suspend-to-RAM), disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)
    [--duration]   Suspend duration in seconds
    --flags   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.
……

3.Use virsh nodesuspend to test:
# virsh nodesuspend mem 20
error: The host was not suspended
error: invalid argument: Suspend duration is too short

# virsh nodesuspend mem 60
error: The host was not suspended
error: invalid argument: Suspend duration is too short

When the time  duration is larger than 60,it can execute the command.
# virsh nodesuspend mem 61

Checked libvirtd.log :
2012-06-01 08:02:49.880+0000: 1860: error : virNodeSuspendSetNodeWakeup:99 : invalid argument: Suspend duration is too short
2012-06-01 08:02:55.384+0000: 1858: error : virNodeSuspendSetNodeWakeup:99 : invalid argument: Suspend duration is too short

Actual results:
Minimum value for nodesuspend time duration is not given in virsh manual or help

Expected results:
Minimum value for nodesuspend time duration need be given in virsh manual or help

Additional info:

Comment 3 Gunannan Ren 2012-07-18 13:19:38 UTC
yes, the duration needs to be more than 60 seconds.

src/util/virnodesuspend.c

#define MIN_TIME_REQ_FOR_SUSPEND 60 /* in seconds */

...

    if (alarmTime <= MIN_TIME_REQ_FOR_SUSPEND) {
        virNodeSuspendError(VIR_ERR_INVALID_ARG, "%s", _("Suspend duration is too short"));
        return -1;
    }

Comment 4 Gunannan Ren 2012-07-19 09:02:46 UTC
patch sent to upstream
https://www.redhat.com/archives/libvir-list/2012-July/msg00887.html

Comment 5 Gunannan Ren 2012-07-30 09:41:40 UTC
commit 7aea9b8cf7808d0fe77b5c9323be8f879bc2f1e6
Author: Guannan Ren <gren>
Date:   Wed Jul 25 13:52:49 2012 +0800

    util: set minimum value of nodesuspend duration to 60 seconds
    
    Change the permissible minimum value of nodesuspend duration time
    to 60 seconds. If option is less than the value, reports error.
    Update virsh help and manpage the infomation.

Comment 7 yuping zhang 2012-08-06 07:05:19 UTC
Verified this issue with libvirt-0.10.0-0rc0.el6.x86_64.

# 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 <=====Added.
    --flags <number>  Suspend flags, 0 for default

#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.

   ....

So change the bug status to VERIFIED.

Comment 8 errata-xmlrpc 2013-02-21 07:16:02 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.

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