提交 ab545815 编写于 作者: J Jiri Denemark

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.
上级 3cdf4dd4
...@@ -506,7 +506,6 @@ static const vshCmdOptDef opts_node_suspend[] = { ...@@ -506,7 +506,6 @@ static const vshCmdOptDef opts_node_suspend[] = {
{"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), " {"target", VSH_OT_DATA, VSH_OFLAG_REQ, N_("mem(Suspend-to-RAM), "
"disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")}, "disk(Suspend-to-Disk), hybrid(Hybrid-Suspend)")},
{"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, at least 60")}, {"duration", VSH_OT_INT, VSH_OFLAG_REQ, N_("Suspend duration in seconds, at least 60")},
{"flags", VSH_OT_INT, VSH_OFLAG_NONE, N_("Suspend flags, 0 for default")},
{NULL, 0, 0, NULL} {NULL, 0, 0, NULL}
}; };
...@@ -516,7 +515,6 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd) ...@@ -516,7 +515,6 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd)
const char *target = NULL; const char *target = NULL;
unsigned int suspendTarget; unsigned int suspendTarget;
long long duration; long long duration;
unsigned int flags = 0;
if (vshCommandOptString(cmd, "target", &target) < 0) { if (vshCommandOptString(cmd, "target", &target) < 0) {
vshError(ctl, _("Invalid target argument")); vshError(ctl, _("Invalid target argument"));
...@@ -528,11 +526,6 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd) ...@@ -528,11 +526,6 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd)
return false; return false;
} }
if (vshCommandOptUInt(cmd, "flags", &flags) < 0) {
vshError(ctl, _("Invalid flags argument"));
return false;
}
if (STREQ(target, "mem")) if (STREQ(target, "mem"))
suspendTarget = VIR_NODE_SUSPEND_TARGET_MEM; suspendTarget = VIR_NODE_SUSPEND_TARGET_MEM;
else if (STREQ(target, "disk")) else if (STREQ(target, "disk"))
...@@ -549,8 +542,7 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd) ...@@ -549,8 +542,7 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd)
return false; return false;
} }
if (virNodeSuspendForDuration(ctl->conn, suspendTarget, duration, if (virNodeSuspendForDuration(ctl->conn, suspendTarget, duration, 0) < 0) {
flags) < 0) {
vshError(ctl, "%s", _("The host was not suspended")); vshError(ctl, "%s", _("The host was not suspended"));
return false; return false;
} }
......
...@@ -294,7 +294,7 @@ statistics during 1 second. ...@@ -294,7 +294,7 @@ statistics during 1 second.
Returns memory stats of the node. Returns memory stats of the node.
If I<cell> is specified, this will prints specified cell statistics only. If I<cell> is specified, this will prints specified cell statistics only.
=item B<nodesuspend> [I<target>] [I<duration>] [I<flags>] =item B<nodesuspend> [I<target>] [I<duration>]
Puts the node (host machine) into a system-wide sleep state such as 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 Suspend-to-RAM, Suspend-to-Disk or Hybrid-Suspend and sets up a
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册