diff --git a/tools/virsh.c b/tools/virsh.c index 1828d19f2115a7c56b898ea27f73347229c433c1..8acc71a3c36c8367b8a47598674db1429adec0fb 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -5507,7 +5507,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; }