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)
goto cleanup;
if (!(vcpupin->cpumask =
virBitmapNew(VIR_DOMAIN_CPUMASK_LEN))) {
if (!(vcpupin->cpumask = virBitmapNewCopy(vm->def->cpumask))) {
VIR_FREE(vcpupin);
goto cleanup;
}
virBitmapCopy(vcpupin->cpumask, vm->def->cpumask);
vcpupin->id = i;
if (VIR_APPEND_ELEMENT_COPY(vm->def->cputune.vcpupin,
vm->def->cputune.nvcpupin, vcpupin) < 0) {