提交 edbdc45b 编写于 作者: P Peter Krempa

virsh-host: Update host commands to use vshCommandOptStringReq

上级 fa956d90
......@@ -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"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册