提交 cba21fd9 编写于 作者: P Peter Krempa 提交者: Cole Robinson

virsh: Improve error when trying to change vm's cpu count 0

This patch adds a check for the count of processors the user requests
for the guest machine so that invalid values produce a more helpful
error message.
(cherry picked from commit de924ca9)
上级 d020d73f
...@@ -5507,7 +5507,7 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd) ...@@ -5507,7 +5507,7 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL))) if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false; return false;
if (vshCommandOptInt(cmd, "count", &count) < 0) { if (vshCommandOptInt(cmd, "count", &count) < 0 || count <= 0) {
vshError(ctl, "%s", _("Invalid number of virtual CPUs")); vshError(ctl, "%s", _("Invalid number of virtual CPUs"));
goto cleanup; goto cleanup;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册