[libvirt PATCH 06/39] cpu_x86: Use glib allocation for virCPUx86Map

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

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/cpu/cpu_x86.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 4a0413db16..bcb87d6f93 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -1566,23 +1566,24 @@ x86MapFree(virCPUx86MapPtr map)
 
     for (i = 0; i < map->nfeatures; i++)
         x86FeatureFree(map->features[i]);
-    VIR_FREE(map->features);
+    g_free(map->features);
 
     for (i = 0; i < map->nmodels; i++)
         x86ModelFree(map->models[i]);
-    VIR_FREE(map->models);
+    g_free(map->models);
 
     for (i = 0; i < map->nvendors; i++)
         x86VendorFree(map->vendors[i]);
-    VIR_FREE(map->vendors);
+    g_free(map->vendors);
 
     /* migrate_blockers only points to the features from map->features list,
      * which were already freed above
      */
-    VIR_FREE(map->migrate_blockers);
+    g_free(map->migrate_blockers);
 
-    VIR_FREE(map);
+    g_free(map);
 }
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Map, x86MapFree);
 
 
 static virCPUx86MapPtr
@@ -1590,8 +1591,7 @@ virCPUx86LoadMap(void)
 {
     virCPUx86MapPtr map;
 
-    if (VIR_ALLOC(map) < 0)
-        return NULL;
+    map = g_new0(virCPUx86Map, 1);
 
     if (cpuMapLoad("x86", x86VendorParse, x86FeatureParse, x86ModelParse, map) < 0)
         goto error;
-- 
2.26.0





[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]

  Powered by Linux