1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemu: Reuse virBitmapToDataBuf in qemuDomainGetEmulatorPinInfo

This commit is contained in:
Peter Krempa 2015-05-29 13:52:29 +02:00
parent b6d438e10c
commit f79bfd9b51

View File

@ -5508,8 +5508,6 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
virBitmapPtr cpumask = NULL;
virBitmapPtr bitmap = NULL;
virCapsPtr caps = NULL;
unsigned char *tmpmap = NULL;
int tmpmaplen;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, -1);
@ -5547,12 +5545,7 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom,
cpumask = bitmap;
}
if (virBitmapToData(cpumask, &tmpmap, &tmpmaplen) < 0)
goto cleanup;
if (tmpmaplen > maplen)
tmpmaplen = maplen;
memcpy(cpumaps, tmpmap, tmpmaplen);
VIR_FREE(tmpmap);
virBitmapToDataBuf(cpumask, cpumaps, maplen);
ret = 1;