mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-04 10:55:19 +00:00
qemu: process: Don't use shifted indexes for vcpu order verification
Allocate a one larger bitmap rather than shifting the indexes back to zero.
This commit is contained in:
parent
3d5dd28995
commit
8924f1b256
@ -4788,7 +4788,7 @@ qemuProcessValidateHotpluggableVcpus(virDomainDefPtr def)
|
|||||||
virBitmapPtr ordermap = NULL;
|
virBitmapPtr ordermap = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!(ordermap = virBitmapNew(maxvcpus)))
|
if (!(ordermap = virBitmapNew(maxvcpus + 1)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* validate:
|
/* validate:
|
||||||
@ -4805,13 +4805,13 @@ qemuProcessValidateHotpluggableVcpus(virDomainDefPtr def)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (vcpu->order != 0) {
|
if (vcpu->order != 0) {
|
||||||
if (virBitmapIsBitSet(ordermap, vcpu->order - 1)) {
|
if (virBitmapIsBitSet(ordermap, vcpu->order)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("duplicate vcpu order '%u'"), vcpu->order);
|
_("duplicate vcpu order '%u'"), vcpu->order);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
ignore_value(virBitmapSetBit(ordermap, vcpu->order - 1));
|
ignore_value(virBitmapSetBit(ordermap, vcpu->order));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user