mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
qemu: Copy bitmap in a sane way
Use virBitmapNewCopy instead of a combination of virBitmapNew and virBitmapCopy.
This commit is contained in:
parent
6afb0d04fe
commit
4c7fb93d5a
@ -4759,12 +4759,10 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
|
|||||||
if (VIR_ALLOC(vcpupin) < 0)
|
if (VIR_ALLOC(vcpupin) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!(vcpupin->cpumask =
|
if (!(vcpupin->cpumask = virBitmapNewCopy(vm->def->cpumask))) {
|
||||||
virBitmapNew(VIR_DOMAIN_CPUMASK_LEN))) {
|
|
||||||
VIR_FREE(vcpupin);
|
VIR_FREE(vcpupin);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
virBitmapCopy(vcpupin->cpumask, vm->def->cpumask);
|
|
||||||
vcpupin->id = i;
|
vcpupin->id = i;
|
||||||
if (VIR_APPEND_ELEMENT_COPY(vm->def->cputune.vcpupin,
|
if (VIR_APPEND_ELEMENT_COPY(vm->def->cputune.vcpupin,
|
||||||
vm->def->cputune.nvcpupin, vcpupin) < 0) {
|
vm->def->cputune.nvcpupin, vcpupin) < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user