From: Peter Krempa Date: Fri, 29 May 2015 11:52:29 +0000 (+0200) Subject: qemu: Reuse virBitmapToDataBuf in qemuDomainGetEmulatorPinInfo X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f79bfd9b51c762410030131d9850e96856bec45c;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git qemu: Reuse virBitmapToDataBuf in qemuDomainGetEmulatorPinInfo --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f6107b778..3fdc4483c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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;