[PATCH 06/35] qemu: Reuse virBitmapToDataBuf in qemuDomainGetEmulatorPinInfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/qemu/qemu_driver.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f6107b7..3fdc448 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;

-- 
2.4.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]