提交 4b5a7930 编写于 作者: O Osier Yang 提交者: Cole Robinson

virsh: Back out if the argument for vol-create-as is malformed

(cherry picked from commit ee58b581)

Conflicts:

	tools/virsh.c
上级 9274256d
......@@ -11121,18 +11121,24 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
if (vshCommandOptString(cmd, "capacity", &capacityStr) <= 0)
goto cleanup;
if (vshVolSize(capacityStr, &capacity) < 0)
if (vshVolSize(capacityStr, &capacity) < 0) {
vshError(ctl, _("Malformed size %s"), capacityStr);
goto cleanup;
}
if ((vshCommandOptString(cmd, "allocation", &allocationStr) > 0) &&
(vshVolSize(allocationStr, &allocation) < 0))
if (vshCommandOptString(cmd, "allocation", &allocationStr) > 0 &&
vshVolSize(allocationStr, &allocation) < 0) {
vshError(ctl, _("Malformed size %s"), allocationStr);
goto cleanup;
}
if (vshCommandOptString(cmd, "format", &format) < 0 ||
vshCommandOptString(cmd, "backing-vol", &snapshotStrVol) < 0 ||
vshCommandOptString(cmd, "backing-vol-format",
&snapshotStrFormat) < 0) {
vshError(ctl, "%s", _("missing argument"));
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册