]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Reuse virBitmapToDataBuf in qemuDomainGetEmulatorPinInfo
authorPeter Krempa <pkrempa@redhat.com>
Fri, 29 May 2015 11:52:29 +0000 (13:52 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 3 Jun 2015 07:42:07 +0000 (09:42 +0200)
src/qemu/qemu_driver.c

index f6107b778489f77b670e6278947c0ff626ed438b..3fdc4483cea55defec8d5386208867a9e1807914 100644 (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;