mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-05 00:13:48 +00:00
virsh: Print error message if argument parsing fails for cmdNodesuspend
If parsing of arguments failed, virsh did silently exit returning and error state, but not specifying the possible problem. * tools/virsh: cmdNodesuspend: - error handling added
This commit is contained in:
parent
98b942c6f5
commit
b72c774b88
@ -5270,14 +5270,20 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd)
|
|||||||
if (!vshConnectionUsability(ctl, ctl->conn))
|
if (!vshConnectionUsability(ctl, ctl->conn))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (vshCommandOptString(cmd, "target", &target) < 0)
|
if (vshCommandOptString(cmd, "target", &target) < 0) {
|
||||||
|
vshError(ctl, _("Invalid target argument"));
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (vshCommandOptLongLong(cmd, "duration", &duration) < 0)
|
if (vshCommandOptLongLong(cmd, "duration", &duration) < 0) {
|
||||||
|
vshError(ctl, _("Invalid duration argument"));
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (vshCommandOptUInt(cmd, "flags", &flags) < 0)
|
if (vshCommandOptUInt(cmd, "flags", &flags) < 0) {
|
||||||
|
vshError(ctl, _("Invalid flags argument"));
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (STREQ(target, "mem"))
|
if (STREQ(target, "mem"))
|
||||||
suspendTarget = VIR_NODE_SUSPEND_TARGET_MEM;
|
suspendTarget = VIR_NODE_SUSPEND_TARGET_MEM;
|
||||||
|
Loading…
Reference in New Issue
Block a user