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);
if (vshCommandOptString(cmd, "name", &name) < 0) {
vshError(ctl, "%s", _("Please specify valid connection URI"));
if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
return false;
}
ctl->name = vshStrdup(ctl, name);
ctl->useGetInfo = false;
@ -550,10 +549,8 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd)
unsigned int suspendTarget;
long long duration;
if (vshCommandOptString(cmd, "target", &target) < 0) {
vshError(ctl, _("Invalid target argument"));
if (vshCommandOptStringReq(ctl, cmd, "target", &target) < 0)
return false;
}
if (vshCommandOptLongLong(cmd, "duration", &duration) < 0) {
vshError(ctl, _("Invalid duration argument"));