mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
qemu: process: Disallow VMs with 0 vcpus
Counterintuitively the user would end up with a VM with maximum number of vCPUs available. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1290324
This commit is contained in:
parent
adca15cf15
commit
b3c91b8a50
@ -3897,6 +3897,12 @@ qemuValidateCpuCount(virDomainDefPtr def,
|
||||
{
|
||||
unsigned int maxCpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, def->os.machine);
|
||||
|
||||
if (virDomainDefGetVcpus(def) == 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Domain requires at least 1 vCPU"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (maxCpus > 0 && virDomainDefGetVcpusMax(def) > maxCpus) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Maximum CPUs greater than specified machine type limit"));
|
||||
|
Loading…
Reference in New Issue
Block a user