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

[libvirt PATCH 7/7] cpu: Replace VIR_FREE with g_free



Signed-off-by: Tim Wiederhake <twiederh redhat com>
---
 src/cpu/cpu.c       |  2 +-
 src/cpu/cpu_map.c   |  6 +++---
 src/cpu/cpu_ppc64.c | 18 +++++++++---------
 src/cpu/cpu_x86.c   | 10 +++++-----
 4 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index c3eef52c79..188c5d86b5 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -315,7 +315,7 @@ virCPUDataFree(virCPUDataPtr data)
     if ((driver = cpuGetSubDriver(data->arch)) && driver->dataFree)
         driver->dataFree(data);
     else
-        VIR_FREE(data);
+        g_free(data);
 }
 
 
diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c
index 65d244e011..7859eef9aa 100644
--- a/src/cpu/cpu_map.c
+++ b/src/cpu/cpu_map.c
@@ -64,7 +64,7 @@ loadData(const char *mapfile,
         VIR_DEBUG("Load %s name %s", element, name);
         ctxt->node = nodes[i];
         rv = callback(ctxt, name, data);
-        VIR_FREE(name);
+        g_free(name);
         if (rv < 0)
             return -1;
     }
@@ -133,10 +133,10 @@ loadIncludes(xmlXPathContextPtr ctxt,
         }
         VIR_DEBUG("Finding CPU map include '%s'", filename);
         if (cpuMapLoadInclude(filename, vendorCB, featureCB, modelCB, data) < 0) {
-            VIR_FREE(filename);
+            g_free(filename);
             return -1;
         }
-        VIR_FREE(filename);
+        g_free(filename);
     }
 
     return 0;
diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index 6477b4bce7..7a36981e12 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -126,7 +126,7 @@ ppc64DataClear(virCPUppc64Data *data)
     if (!data)
         return;
 
-    VIR_FREE(data->pvr);
+    g_free(data->pvr);
 }
 
 static int
@@ -151,8 +151,8 @@ ppc64VendorFree(virCPUppc64VendorPtr vendor)
     if (!vendor)
         return;
 
-    VIR_FREE(vendor->name);
-    VIR_FREE(vendor);
+    g_free(vendor->name);
+    g_free(vendor);
 }
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUppc64Vendor, ppc64VendorFree);
 
@@ -177,8 +177,8 @@ ppc64ModelFree(virCPUppc64ModelPtr model)
         return;
 
     ppc64DataClear(&model->data);
-    VIR_FREE(model->name);
-    VIR_FREE(model);
+    g_free(model->name);
+    g_free(model);
 }
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUppc64Model, ppc64ModelFree);
 
@@ -261,13 +261,13 @@ ppc64MapFree(virCPUppc64MapPtr map)
 
     for (i = 0; i < map->nmodels; i++)
         ppc64ModelFree(map->models[i]);
-    VIR_FREE(map->models);
+    g_free(map->models);
 
     for (i = 0; i < map->nvendors; i++)
         ppc64VendorFree(map->vendors[i]);
-    VIR_FREE(map->vendors);
+    g_free(map->vendors);
 
-    VIR_FREE(map);
+    g_free(map);
 }
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUppc64Map, ppc64MapFree);
 
@@ -584,7 +584,7 @@ virCPUppc64DataFree(virCPUDataPtr data)
         return;
 
     ppc64DataClear(&data->data.ppc64);
-    VIR_FREE(data);
+    g_free(data);
 }
 
 
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index fdb665b01d..6a46e186ce 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -493,7 +493,7 @@ virCPUx86DataFree(virCPUDataPtr data)
         return;
 
     virCPUx86DataClear(&data->data.x86);
-    VIR_FREE(data);
+    g_free(data);
 }
 
 
@@ -1805,7 +1805,7 @@ virCPUx86DataParse(xmlXPathContextPtr ctxt)
             if (message) \
                 *message = g_strdup_printf("%s: %s", _(MSG), flagsStr); \
             VIR_DEBUG("%s: %s", MSG, flagsStr); \
-            VIR_FREE(flagsStr); \
+            g_free(flagsStr); \
         } while (0)
 
 
@@ -2208,7 +2208,7 @@ x86Decode(virCPUDefPtr cpu,
             if (x86FeatureIsMigratable(cpuModel->features[i].name, map)) {
                 i++;
             } else {
-                VIR_FREE(cpuModel->features[i].name);
+                g_free(cpuModel->features[i].name);
                 VIR_DELETE_ELEMENT_INPLACE(cpuModel->features, i,
                                            cpuModel->nfeatures);
             }
@@ -2893,7 +2893,7 @@ virCPUx86Baseline(virCPUDefPtr *cpus,
         cpu->fallback = VIR_CPU_FALLBACK_FORBID;
 
     if (!outputVendor)
-        VIR_FREE(cpu->vendor);
+        g_clear_pointer(&cpu->vendor, g_free);
 
     return g_steal_pointer(&cpu);
 }
@@ -2915,7 +2915,7 @@ x86UpdateHostModel(virCPUDefPtr guest,
         return -1;
 
     if (guest->vendor_id) {
-        VIR_FREE(updated->vendor_id);
+        g_free(updated->vendor_id);
         updated->vendor_id = g_strdup(guest->vendor_id);
     }
 
-- 
2.26.2


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