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:
Peter Krempa 2016-09-16 15:51:14 +02:00
parent 8924f1b256
commit 6ff3e65012

View File

@ -4811,9 +4811,13 @@ 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);