[libvirt] [PATCH] doc: update the minimum value for nodesuspend time duration

libvirt asks the duration time is above 60 seconds in code src/util/virnodesuspend.c: define MIN_TIME_REQ_FOR_SUSPEND 60 /* in seconds */ We should update the information in virsh help and manpage. --- tools/virsh.c | 3 ++- tools/virsh.pod | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index b9e159b..95b2689 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -6986,7 +6986,8 @@ static const vshCmdInfo info_nodesuspend[] = { static const vshCmdOptDef opts_node_suspend[] = { {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds")}, + {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, " + "above 60 seconds at least")}, {"flags", VSH_OT_INT, VSH_OFLAG_NONE, N_("Suspend flags, 0 for default")}, {NULL, 0, 0, NULL} }; diff --git a/tools/virsh.pod b/tools/virsh.pod index 4bddf15..8d41b05 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -290,7 +290,8 @@ If I<cell> is specified, this will prints specified cell statistics only. 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. +specified by the 'duration' parameter. The duration time should be given +above 60 seconds. =item B<capabilities> -- 1.7.7.5

On 07/19/2012 03:05 AM, Guannan Ren wrote:
libvirt asks the duration time is above 60 seconds in code
src/util/virnodesuspend.c: define MIN_TIME_REQ_FOR_SUSPEND 60 /* in seconds */
We should update the information in virsh help and manpage. --- tools/virsh.c | 3 ++- tools/virsh.pod | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index b9e159b..95b2689 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -6986,7 +6986,8 @@ static const vshCmdInfo info_nodesuspend[] = { static const vshCmdOptDef opts_node_suspend[] = { {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds")}, + {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, " + "above 60 seconds at least")},
I'd write this: {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, at least 60")},
+++ b/tools/virsh.pod @@ -290,7 +290,8 @@ If I<cell> is specified, this will prints specified cell statistics only. 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. +specified by the 'duration' parameter. The duration time should be given +above 60 seconds.
It would read better as: The duration time should be at least 60 seconds. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

libvirt asks the duration time is above 60 seconds in code src/util/virnodesuspend.c: define MIN_TIME_REQ_FOR_SUSPEND 60 /* in seconds */ if (alarmTime <= MIN_TIME_REQ_FOR_SUSPEND) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Suspend duration is too short")); return -1; } Update the information in virsh help and manpage. --- tools/virsh.c | 2 +- tools/virsh.pod | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index b9e159b..21ebca2 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -6986,7 +6986,7 @@ static const vshCmdInfo info_nodesuspend[] = { static const vshCmdOptDef opts_node_suspend[] = { {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds")}, + {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, above 60 seconds")}, {"flags", VSH_OT_INT, VSH_OFLAG_NONE, N_("Suspend flags, 0 for default")}, {NULL, 0, 0, NULL} }; diff --git a/tools/virsh.pod b/tools/virsh.pod index 4bddf15..690707f 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -290,7 +290,8 @@ If I<cell> is specified, this will prints specified cell statistics only. 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. +specified by the 'duration' parameter. The duration time should be above +60 seconds. =item B<capabilities> -- 1.7.7.5

On 07/20/2012 09:47 PM, Guannan Ren wrote:
libvirt asks the duration time is above 60 seconds in code
src/util/virnodesuspend.c: define MIN_TIME_REQ_FOR_SUSPEND 60 /* in seconds */
if (alarmTime <= MIN_TIME_REQ_FOR_SUSPEND) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Suspend duration is too short")); return -1; }
Update the information in virsh help and manpage. --- tools/virsh.c | 2 +- tools/virsh.pod | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index b9e159b..21ebca2 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -6986,7 +6986,7 @@ static const vshCmdInfo info_nodesuspend[] = { static const vshCmdOptDef opts_node_suspend[] = { {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds")}, + {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, above 60 seconds")}, {"flags", VSH_OT_INT, VSH_OFLAG_NONE, N_("Suspend flags, 0 for default")}, {NULL, 0, 0, NULL} }; diff --git a/tools/virsh.pod b/tools/virsh.pod index 4bddf15..690707f 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -290,7 +290,8 @@ If I<cell> is specified, this will prints specified cell statistics only. 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. +specified by the 'duration' parameter. The duration time should be above +60 seconds.
=item B<capabilities>
ping

On 07/20/2012 07:47 AM, Guannan Ren wrote:
libvirt asks the duration time is above 60 seconds in code
src/util/virnodesuspend.c: define MIN_TIME_REQ_FOR_SUSPEND 60 /* in seconds */
if (alarmTime <= MIN_TIME_REQ_FOR_SUSPEND) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Suspend duration is too short")); return -1; }
Update the information in virsh help and manpage. --- tools/virsh.c | 2 +- tools/virsh.pod | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index b9e159b..21ebca2 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -6986,7 +6986,7 @@ static const vshCmdInfo info_nodesuspend[] = { static const vshCmdOptDef opts_node_suspend[] = { {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds")}, + {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, above 60 seconds")},
s/above/at least/
{"flags", VSH_OT_INT, VSH_OFLAG_NONE, N_("Suspend flags, 0 for default")}, {NULL, 0, 0, NULL} }; diff --git a/tools/virsh.pod b/tools/virsh.pod index 4bddf15..690707f 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -290,7 +290,8 @@ If I<cell> is specified, this will prints specified cell statistics only. 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. +specified by the 'duration' parameter. The duration time should be above +60 seconds.
and again. ACK with that wording change. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 07/23/2012 11:10 PM, Eric Blake wrote:
On 07/20/2012 07:47 AM, Guannan Ren wrote:
libvirt asks the duration time is above 60 seconds in code
src/util/virnodesuspend.c: define MIN_TIME_REQ_FOR_SUSPEND 60 /* in seconds */
if (alarmTime <= MIN_TIME_REQ_FOR_SUSPEND) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Suspend duration is too short")); return -1; }
Update the information in virsh help and manpage. --- tools/virsh.c | 2 +- tools/virsh.pod | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index b9e159b..21ebca2 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -6986,7 +6986,7 @@ static const vshCmdInfo info_nodesuspend[] = { static const vshCmdOptDef opts_node_suspend[] = { {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds")}, + {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, above 60 seconds")}, s/above/at least/
{"flags", VSH_OT_INT, VSH_OFLAG_NONE, N_("Suspend flags, 0 for default")}, {NULL, 0, 0, NULL} }; diff --git a/tools/virsh.pod b/tools/virsh.pod index 4bddf15..690707f 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -290,7 +290,8 @@ If I<cell> is specified, this will prints specified cell statistics only. 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. +specified by the 'duration' parameter. The duration time should be above +60 seconds.
and again.
ACK with that wording change.
Sorry, "at least 60 seconds" means the 60 is permissible minimun value. but actually according to the code, the 61 seconds is the minimun value. Or we change the code from "<=" to "<"? if (alarmTime <= MIN_TIME_REQ_FOR_SUSPEND) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Suspend duration is too short")); return -1; }

On 07/23/2012 09:08 PM, Guannan Ren wrote:
On 07/23/2012 11:10 PM, Eric Blake wrote:
On 07/20/2012 07:47 AM, Guannan Ren wrote:
libvirt asks the duration time is above 60 seconds in code
-specified by the 'duration' parameter. +specified by the 'duration' parameter. The duration time should be above +60 seconds. and again.
ACK with that wording change.
'at least 61' sounds better than 'above 60', if we don't change the code.
Sorry, "at least 60 seconds" means the 60 is permissible minimun value. but actually according to the code, the 61 seconds is the minimun value. Or we change the code from "<=" to "<"?
if (alarmTime <= MIN_TIME_REQ_FOR_SUSPEND) {
Indeed, this seems like an off-by-one, changing it to '<' makes sense. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 07/24/2012 08:38 AM, Guannan Ren wrote:
On 07/23/2012 11:10 PM, Eric Blake wrote:
On 07/20/2012 07:47 AM, Guannan Ren wrote:
libvirt asks the duration time is above 60 seconds in code
src/util/virnodesuspend.c: define MIN_TIME_REQ_FOR_SUSPEND 60 /* in seconds */
if (alarmTime <= MIN_TIME_REQ_FOR_SUSPEND) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Suspend duration is too short")); return -1; }
Update the information in virsh help and manpage. --- tools/virsh.c | 2 +- tools/virsh.pod | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index b9e159b..21ebca2 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -6986,7 +6986,7 @@ static const vshCmdInfo info_nodesuspend[] = { static const vshCmdOptDef opts_node_suspend[] = { {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), "
"disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds")}, + {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, above 60 seconds")}, s/above/at least/
{"flags", VSH_OT_INT, VSH_OFLAG_NONE, N_("Suspend flags, 0 for default")}, {NULL, 0, 0, NULL} }; diff --git a/tools/virsh.pod b/tools/virsh.pod index 4bddf15..690707f 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -290,7 +290,8 @@ If I<cell> is specified, this will prints specified cell statistics only. 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. +specified by the 'duration' parameter. The duration time should be above +60 seconds.
and again.
ACK with that wording change.
Sorry, "at least 60 seconds" means the 60 is permissible minimun value. but actually according to the code, the 61 seconds is the minimun value. Or we change the code from "<=" to "<"?
if (alarmTime <= MIN_TIME_REQ_FOR_SUSPEND) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Suspend duration is too short")); return -1; }
You could change the code, to accept 60 seconds or more as a valid value. 60 seconds is not a hard-and-fast rule anyway.. Its just a good estimate that aims to be on the safer side, that's all. Regards, Srivatsa S. Bhat IBM Linux Technology Center

On 07/19/2012 09:24 PM, Eric Blake wrote:
On 07/19/2012 03:05 AM, Guannan Ren wrote:
libvirt asks the duration time is above 60 seconds in code
src/util/virnodesuspend.c: define MIN_TIME_REQ_FOR_SUSPEND 60 /* in seconds */
We should update the information in virsh help and manpage. --- tools/virsh.c | 3 ++- tools/virsh.pod | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index b9e159b..95b2689 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -6986,7 +6986,8 @@ static const vshCmdInfo info_nodesuspend[] = { static const vshCmdOptDef opts_node_suspend[] = { {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, - {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds")}, + {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, " + "above 60 seconds at least")}, I'd write this:
{"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, at least 60")},
+++ b/tools/virsh.pod @@ -290,7 +290,8 @@ If I<cell> is specified, this will prints specified cell statistics only. 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. +specified by the 'duration' parameter. The duration time should be given +above 60 seconds. It would read better as:
The duration time should be at least 60 seconds.
It's humiliating, the syntax of that sentence is wrong even in Mandarin. The value should be above 60 seconds, I supplemented the related code in git commit log area. Thanks for the review. Guannan
participants (3)
-
Eric Blake
-
Guannan Ren
-
Srivatsa S. Bhat