qemu: Copy bitmap in a sane way

Use virBitmapNewCopy instead of a combination of virBitmapNew and
virBitmapCopy.
This commit is contained in:
Peter Krempa 2015-03-27 13:56:30 +01:00
parent 6afb0d04fe
commit 4c7fb93d5a

View File

@ -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) {