mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 07:36:19 +00:00
qemu: process: Enforce 'vcpu' order range to <1,maxvcpus>
The current code that validates duplicate vcpu order would not work properly if the order would exceed def->maxvcpus. Limit the order to the interval described.
This commit is contained in:
parent
8924f1b256
commit
6ff3e65012
@ -4811,10 +4811,14 @@ qemuProcessValidateHotpluggableVcpus(virDomainDefPtr def)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
ignore_value(virBitmapSetBit(ordermap, vcpu->order));
|
if (virBitmapSetBit(ordermap, vcpu->order)) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("vcpu order '%u' exceeds vcpu count"),
|
||||||
|
vcpu->order);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (j = i + 1; j < (i + vcpupriv->vcpus); j++) {
|
for (j = i + 1; j < (i + vcpupriv->vcpus); j++) {
|
||||||
subvcpu = virDomainDefGetVcpu(def, j);
|
subvcpu = virDomainDefGetVcpu(def, j);
|
||||||
if (subvcpu->hotpluggable != vcpu->hotpluggable ||
|
if (subvcpu->hotpluggable != vcpu->hotpluggable ||
|
||||||
|
Loading…
Reference in New Issue
Block a user