mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
virsh-host: Update host commands to use vshCommandOptStringReq
This commit is contained in:
parent
fa956d9055
commit
edbdc45b6d
@ -103,10 +103,9 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VIR_FREE(ctl->name);
|
VIR_FREE(ctl->name);
|
||||||
if (vshCommandOptString(cmd, "name", &name) < 0) {
|
if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
|
||||||
vshError(ctl, "%s", _("Please specify valid connection URI"));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
ctl->name = vshStrdup(ctl, name);
|
ctl->name = vshStrdup(ctl, name);
|
||||||
|
|
||||||
ctl->useGetInfo = false;
|
ctl->useGetInfo = false;
|
||||||
@ -550,10 +549,8 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd)
|
|||||||
unsigned int suspendTarget;
|
unsigned int suspendTarget;
|
||||||
long long duration;
|
long long duration;
|
||||||
|
|
||||||
if (vshCommandOptString(cmd, "target", &target) < 0) {
|
if (vshCommandOptStringReq(ctl, 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"));
|
vshError(ctl, _("Invalid duration argument"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user