diff --git a/tools/virsh.c b/tools/virsh.c index 265857d700d84fb72336c94875ee3209a38e7285..035482269b59213e9f507b9d2dc909489f3000f3 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -5752,7 +5752,7 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd) if (!(dom = vshCommandOptDomain(ctl, cmd, NULL))) return false; - if (vshCommandOptInt(cmd, "count", &count) < 0) { + if (vshCommandOptInt(cmd, "count", &count) < 0 || count <= 0) { vshError(ctl, "%s", _("Invalid number of virtual CPUs")); goto cleanup; }