virsh-host: Update host commands to use vshCommandOptStringReq

This commit is contained in:
Peter Krempa 2013-01-21 17:17:19 +01:00
parent fa956d9055
commit edbdc45b6d

View File

@ -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"));