mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 10:03:49 +03:00
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.
This commit is contained in:
parent
0dda594da9
commit
de924ca90a
@ -5752,7 +5752,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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user