[libvirt PATCH 02/21] util: replace VIR_FREE with g_free in all vir*Free() functions

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

 



Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
 src/util/virarptable.c          |  8 +--
 src/util/virauthconfig.c        |  4 +-
 src/util/virbitmap.c            |  4 +-
 src/util/vircgroup.c            | 12 ++---
 src/util/vircommand.c           | 24 ++++-----
 src/util/virconf.c              | 10 ++--
 src/util/virdnsmasq.c           | 16 +++---
 src/util/virebtables.c          |  4 +-
 src/util/virfdstream.c          | 10 ++--
 src/util/virfile.c              |  4 +-
 src/util/virfirewall.c          | 16 +++---
 src/util/virfirmware.c          |  8 +--
 src/util/virjson.c              | 12 ++---
 src/util/virlockspace.c         | 12 ++---
 src/util/virlog.c               | 12 ++---
 src/util/virmacaddr.c           |  2 +-
 src/util/virmdev.c              | 16 +++---
 src/util/virnetdev.c            | 12 ++---
 src/util/virnetdevbandwidth.c   |  6 +--
 src/util/virnetdevip.c          |  6 +--
 src/util/virnetdevmacvlan.c     |  8 +--
 src/util/virnetdevvlan.c        |  2 +-
 src/util/virnvme.c              |  2 +-
 src/util/virobject.c            |  2 +-
 src/util/virpci.c               | 18 +++----
 src/util/virperf.c              |  2 +-
 src/util/virportallocator.c     |  4 +-
 src/util/virresctrl.c           |  6 +--
 src/util/virrotatingfile.c      | 14 ++---
 src/util/virscsi.c              | 16 +++---
 src/util/virscsivhost.c         | 10 ++--
 src/util/virseclabel.c          | 16 +++---
 src/util/virsocketaddr.c        |  2 +-
 src/util/virsysinfo.c           | 96 ++++++++++++++++-----------------
 src/util/virsystemd.c           |  6 +--
 src/util/virthreadpool.c        |  6 +--
 src/util/virtypedparam-public.c |  2 +-
 src/util/virtypedparam.c        |  8 +--
 src/util/viruri.c               | 20 +++----
 src/util/virusb.c               |  8 +--
 src/util/virxml.c               |  4 +-
 41 files changed, 225 insertions(+), 225 deletions(-)

diff --git a/src/util/virarptable.c b/src/util/virarptable.c
index dac3486470..dfe3ebee5b 100644
--- a/src/util/virarptable.c
+++ b/src/util/virarptable.c
@@ -172,9 +172,9 @@ virArpTableFree(virArpTablePtr table)
         return;
 
     for (i = 0; i < table->n; i++) {
-        VIR_FREE(table->t[i].ipaddr);
-        VIR_FREE(table->t[i].mac);
+        g_free(table->t[i].ipaddr);
+        g_free(table->t[i].mac);
     }
-    VIR_FREE(table->t);
-    VIR_FREE(table);
+    g_free(table->t);
+    g_free(table);
 }
diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c
index 6b5487c4b0..0fc1b5c589 100644
--- a/src/util/virauthconfig.c
+++ b/src/util/virauthconfig.c
@@ -88,8 +88,8 @@ void virAuthConfigFree(virAuthConfigPtr auth)
         return;
 
     g_key_file_free(auth->keyfile);
-    VIR_FREE(auth->path);
-    VIR_FREE(auth);
+    g_free(auth->path);
+    g_free(auth);
 }
 
 
diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index 4fde6f4fd2..b2569b0b03 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -94,8 +94,8 @@ void
 virBitmapFree(virBitmapPtr bitmap)
 {
     if (bitmap) {
-        VIR_FREE(bitmap->map);
-        VIR_FREE(bitmap);
+        g_free(bitmap->map);
+        g_free(bitmap);
     }
 }
 
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 15071d8b1b..b11bbc5f9e 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -3580,15 +3580,15 @@ virCgroupFree(virCgroupPtr group)
         return;
 
     for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
-        VIR_FREE(group->legacy[i].mountPoint);
-        VIR_FREE(group->legacy[i].linkPoint);
-        VIR_FREE(group->legacy[i].placement);
+        g_free(group->legacy[i].mountPoint);
+        g_free(group->legacy[i].linkPoint);
+        g_free(group->legacy[i].placement);
     }
 
-    VIR_FREE(group->unified.mountPoint);
-    VIR_FREE(group->unified.placement);
+    g_free(group->unified.mountPoint);
+    g_free(group->unified.placement);
 
-    VIR_FREE(group);
+    g_free(group);
 }
 
 
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index b1a26f68aa..87a60be201 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -3028,25 +3028,25 @@ virCommandFree(virCommandPtr cmd)
             VIR_FORCE_CLOSE(cmd->passfd[i].fd);
     }
     cmd->npassfd = 0;
-    VIR_FREE(cmd->passfd);
+    g_free(cmd->passfd);
 
     if (cmd->asyncioThread) {
         virThreadJoin(cmd->asyncioThread);
-        VIR_FREE(cmd->asyncioThread);
+        g_free(cmd->asyncioThread);
     }
-    VIR_FREE(cmd->inbuf);
+    g_free(cmd->inbuf);
     VIR_FORCE_CLOSE(cmd->outfd);
     VIR_FORCE_CLOSE(cmd->errfd);
 
     for (i = 0; i < cmd->nargs; i++)
-        VIR_FREE(cmd->args[i]);
-    VIR_FREE(cmd->args);
+        g_free(cmd->args[i]);
+    g_free(cmd->args);
 
     for (i = 0; i < cmd->nenv; i++)
-        VIR_FREE(cmd->env[i]);
-    VIR_FREE(cmd->env);
+        g_free(cmd->env[i]);
+    g_free(cmd->env);
 
-    VIR_FREE(cmd->pwd);
+    g_free(cmd->pwd);
 
     if (cmd->handshake) {
         /* The other 2 fds in these arrays are closed
@@ -3056,21 +3056,21 @@ virCommandFree(virCommandPtr cmd)
         VIR_FORCE_CLOSE(cmd->handshakeNotify[1]);
     }
 
-    VIR_FREE(cmd->pidfile);
+    g_free(cmd->pidfile);
 
     if (cmd->reap)
         virCommandAbort(cmd);
 
 #if defined(WITH_SECDRIVER_SELINUX)
-    VIR_FREE(cmd->seLinuxLabel);
+    g_free(cmd->seLinuxLabel);
 #endif
 #if defined(WITH_SECDRIVER_APPARMOR)
-    VIR_FREE(cmd->appArmorProfile);
+    g_free(cmd->appArmorProfile);
 #endif
 
     virCommandFreeSendBuffers(cmd);
 
-    VIR_FREE(cmd);
+    g_free(cmd);
 }
 
 /**
diff --git a/src/util/virconf.c b/src/util/virconf.c
index e983a769ee..d85fc32b64 100644
--- a/src/util/virconf.c
+++ b/src/util/virconf.c
@@ -788,15 +788,15 @@ virConfFree(virConfPtr conf)
     tmp = conf->entries;
     while (tmp) {
         virConfEntryPtr next;
-        VIR_FREE(tmp->name);
+        g_free(tmp->name);
         virConfFreeValue(tmp->value);
-        VIR_FREE(tmp->comment);
+        g_free(tmp->comment);
         next = tmp->next;
-        VIR_FREE(tmp);
+        g_free(tmp);
         tmp = next;
     }
-    VIR_FREE(conf->filename);
-    VIR_FREE(conf);
+    g_free(conf->filename);
+    g_free(conf);
     return 0;
 }
 
diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index 63ac088e06..c21819c981 100644
--- a/src/util/virdnsmasq.c
+++ b/src/util/virdnsmasq.c
@@ -75,14 +75,14 @@ addnhostsFree(dnsmasqAddnHostsfile *addnhostsfile)
         for (i = 0; i < addnhostsfile->nhosts; i++)
             addnhostFree(&addnhostsfile->hosts[i]);
 
-        VIR_FREE(addnhostsfile->hosts);
+        g_free(addnhostsfile->hosts);
 
         addnhostsfile->nhosts = 0;
     }
 
-    VIR_FREE(addnhostsfile->path);
+    g_free(addnhostsfile->path);
 
-    VIR_FREE(addnhostsfile);
+    g_free(addnhostsfile);
 }
 
 static int
@@ -272,14 +272,14 @@ hostsfileFree(dnsmasqHostsfile *hostsfile)
         for (i = 0; i < hostsfile->nhosts; i++)
             dhcphostFree(&hostsfile->hosts[i]);
 
-        VIR_FREE(hostsfile->hosts);
+        g_free(hostsfile->hosts);
 
         hostsfile->nhosts = 0;
     }
 
-    VIR_FREE(hostsfile->path);
+    g_free(hostsfile->path);
 
-    VIR_FREE(hostsfile);
+    g_free(hostsfile);
 }
 
 /* Note:  There are many additional dhcp-host specifications
@@ -465,14 +465,14 @@ dnsmasqContextFree(dnsmasqContext *ctx)
     if (!ctx)
         return;
 
-    VIR_FREE(ctx->config_dir);
+    g_free(ctx->config_dir);
 
     if (ctx->hostsfile)
         hostsfileFree(ctx->hostsfile);
     if (ctx->addnhostsfile)
         addnhostsFree(ctx->addnhostsfile);
 
-    VIR_FREE(ctx);
+    g_free(ctx);
 }
 
 /**
diff --git a/src/util/virebtables.c b/src/util/virebtables.c
index b23ce21ae9..e296cf2578 100644
--- a/src/util/virebtables.c
+++ b/src/util/virebtables.c
@@ -73,8 +73,8 @@ ebtablesContextFree(ebtablesContext *ctx)
 {
     if (!ctx)
         return;
-    VIR_FREE(ctx->chain);
-    VIR_FREE(ctx);
+    g_free(ctx->chain);
+    g_free(ctx);
 }
 
 
diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c
index 1a7b671179..6a2c6844e1 100644
--- a/src/util/virfdstream.c
+++ b/src/util/virfdstream.c
@@ -198,14 +198,14 @@ virFDStreamMsgFree(virFDStreamMsgPtr msg)
 
     switch (msg->type) {
     case VIR_FDSTREAM_MSG_TYPE_DATA:
-        VIR_FREE(msg->stream.data.buf);
+        g_free(msg->stream.data.buf);
         break;
     case VIR_FDSTREAM_MSG_TYPE_HOLE:
         /* nada */
         break;
     }
 
-    VIR_FREE(msg);
+    g_free(msg);
 }
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFDStreamMsg, virFDStreamMsgFree);
@@ -413,9 +413,9 @@ virFDStreamThreadDataFree(virFDStreamThreadDataPtr data)
         return;
 
     virObjectUnref(data->st);
-    VIR_FREE(data->fdinname);
-    VIR_FREE(data->fdoutname);
-    VIR_FREE(data);
+    g_free(data->fdinname);
+    g_free(data->fdoutname);
+    g_free(data);
 }
 
 
diff --git a/src/util/virfile.c b/src/util/virfile.c
index e07f3d6b9c..e25cbe797e 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -382,9 +382,9 @@ virFileWrapperFdFree(virFileWrapperFdPtr wfd)
     if (!wfd)
         return;
 
-    VIR_FREE(wfd->err_msg);
+    g_free(wfd->err_msg);
     virCommandFree(wfd->cmd);
-    VIR_FREE(wfd);
+    g_free(wfd);
 }
 
 
diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c
index b84f0f5f48..8b69a18ecc 100644
--- a/src/util/virfirewall.c
+++ b/src/util/virfirewall.c
@@ -196,9 +196,9 @@ virFirewallRuleFree(virFirewallRulePtr rule)
         return;
 
     for (i = 0; i < rule->argsLen; i++)
-        VIR_FREE(rule->args[i]);
-    VIR_FREE(rule->args);
-    VIR_FREE(rule);
+        g_free(rule->args[i]);
+    g_free(rule->args);
+    g_free(rule);
 }
 
 
@@ -212,13 +212,13 @@ virFirewallGroupFree(virFirewallGroupPtr group)
 
     for (i = 0; i < group->naction; i++)
         virFirewallRuleFree(group->action[i]);
-    VIR_FREE(group->action);
+    g_free(group->action);
 
     for (i = 0; i < group->nrollback; i++)
         virFirewallRuleFree(group->rollback[i]);
-    VIR_FREE(group->rollback);
+    g_free(group->rollback);
 
-    VIR_FREE(group);
+    g_free(group);
 }
 
 
@@ -237,9 +237,9 @@ void virFirewallFree(virFirewallPtr firewall)
 
     for (i = 0; i < firewall->ngroups; i++)
         virFirewallGroupFree(firewall->groups[i]);
-    VIR_FREE(firewall->groups);
+    g_free(firewall->groups);
 
-    VIR_FREE(firewall);
+    g_free(firewall);
 }
 
 #define VIR_FIREWALL_RETURN_IF_ERROR(firewall) \
diff --git a/src/util/virfirmware.c b/src/util/virfirmware.c
index 6b8a64eafa..d49bea3a55 100644
--- a/src/util/virfirmware.c
+++ b/src/util/virfirmware.c
@@ -37,9 +37,9 @@ virFirmwareFree(virFirmwarePtr firmware)
     if (!firmware)
         return;
 
-    VIR_FREE(firmware->name);
-    VIR_FREE(firmware->nvram);
-    VIR_FREE(firmware);
+    g_free(firmware->name);
+    g_free(firmware->nvram);
+    g_free(firmware);
 }
 
 
@@ -51,7 +51,7 @@ virFirmwareFreeList(virFirmwarePtr *firmwares, size_t nfirmwares)
     for (i = 0; i < nfirmwares; i++)
         virFirmwareFree(firmwares[i]);
 
-    VIR_FREE(firmwares);
+    g_free(firmwares);
 }
 
 
diff --git a/src/util/virjson.c b/src/util/virjson.c
index f85b61957c..a509943fde 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -398,28 +398,28 @@ virJSONValueFree(virJSONValuePtr value)
     switch ((virJSONType) value->type) {
     case VIR_JSON_TYPE_OBJECT:
         for (i = 0; i < value->data.object.npairs; i++) {
-            VIR_FREE(value->data.object.pairs[i].key);
+            g_free(value->data.object.pairs[i].key);
             virJSONValueFree(value->data.object.pairs[i].value);
         }
-        VIR_FREE(value->data.object.pairs);
+        g_free(value->data.object.pairs);
         break;
     case VIR_JSON_TYPE_ARRAY:
         for (i = 0; i < value->data.array.nvalues; i++)
             virJSONValueFree(value->data.array.values[i]);
-        VIR_FREE(value->data.array.values);
+        g_free(value->data.array.values);
         break;
     case VIR_JSON_TYPE_STRING:
-        VIR_FREE(value->data.string);
+        g_free(value->data.string);
         break;
     case VIR_JSON_TYPE_NUMBER:
-        VIR_FREE(value->data.number);
+        g_free(value->data.number);
         break;
     case VIR_JSON_TYPE_BOOLEAN:
     case VIR_JSON_TYPE_NULL:
         break;
     }
 
-    VIR_FREE(value);
+    g_free(value);
 }
 
 
diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index 71d5dfb83e..7df319004e 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -102,11 +102,11 @@ static void virLockSpaceResourceFree(virLockSpaceResourcePtr res)
         }
     }
 
-    VIR_FREE(res->owners);
+    g_free(res->owners);
     VIR_FORCE_CLOSE(res->fd);
-    VIR_FREE(res->path);
-    VIR_FREE(res->name);
-    VIR_FREE(res);
+    g_free(res->path);
+    g_free(res->name);
+    g_free(res);
 }
 
 
@@ -499,9 +499,9 @@ void virLockSpaceFree(virLockSpacePtr lockspace)
         return;
 
     virHashFree(lockspace->resources);
-    VIR_FREE(lockspace->dir);
+    g_free(lockspace->dir);
     virMutexDestroy(&lockspace->lock);
-    VIR_FREE(lockspace);
+    g_free(lockspace);
 }
 
 
diff --git a/src/util/virlog.c b/src/util/virlog.c
index fad310a68a..cdfeba8251 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -339,8 +339,8 @@ virLogFilterFree(virLogFilterPtr filter)
     if (!filter)
         return;
 
-    VIR_FREE(filter->match);
-    VIR_FREE(filter);
+    g_free(filter->match);
+    g_free(filter);
 }
 
 
@@ -361,7 +361,7 @@ virLogFilterListFree(virLogFilterPtr *list, int count)
 
     for (i = 0; i < count; i++)
         virLogFilterFree(list[i]);
-    VIR_FREE(list);
+    g_free(list);
 }
 
 
@@ -387,8 +387,8 @@ virLogOutputFree(virLogOutputPtr output)
 
     if (output->c)
         output->c(output->data);
-    VIR_FREE(output->name);
-    VIR_FREE(output);
+    g_free(output->name);
+    g_free(output);
 
 }
 
@@ -410,7 +410,7 @@ virLogOutputListFree(virLogOutputPtr *list, int count)
 
     for (i = 0; i < count; i++)
         virLogOutputFree(list[i]);
-    VIR_FREE(list);
+    g_free(list);
 }
 
 
diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c
index 35918bca41..3811457f31 100644
--- a/src/util/virmacaddr.c
+++ b/src/util/virmacaddr.c
@@ -250,5 +250,5 @@ virMacAddrIsBroadcastRaw(const unsigned char s[VIR_MAC_BUFLEN])
 void
 virMacAddrFree(virMacAddrPtr addr)
 {
-    VIR_FREE(addr);
+    g_free(addr);
 }
diff --git a/src/util/virmdev.c b/src/util/virmdev.c
index 46db6249de..1f5c2cba30 100644
--- a/src/util/virmdev.c
+++ b/src/util/virmdev.c
@@ -183,10 +183,10 @@ virMediatedDeviceFree(virMediatedDevicePtr dev)
 {
     if (!dev)
         return;
-    VIR_FREE(dev->path);
-    VIR_FREE(dev->used_by_drvname);
-    VIR_FREE(dev->used_by_domname);
-    VIR_FREE(dev);
+    g_free(dev->path);
+    g_free(dev->used_by_drvname);
+    g_free(dev->used_by_domname);
+    g_free(dev);
 }
 
 
@@ -476,10 +476,10 @@ virMediatedDeviceTypeFree(virMediatedDeviceTypePtr type)
     if (!type)
         return;
 
-    VIR_FREE(type->id);
-    VIR_FREE(type->name);
-    VIR_FREE(type->device_api);
-    VIR_FREE(type);
+    g_free(type->id);
+    g_free(type->name);
+    g_free(type->device_api);
+    g_free(type);
 }
 
 
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 6ee59989ed..2b4c8b6280 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -127,7 +127,7 @@ struct _virNetDevMcastEntry  {
 static void
 virNetDevMcastEntryFree(virNetDevMcastEntryPtr entry)
 {
-    VIR_FREE(entry);
+    g_free(entry);
 }
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevMcastEntry, virNetDevMcastEntryFree);
@@ -2868,11 +2868,11 @@ void
 virNetDevRxFilterFree(virNetDevRxFilterPtr filter)
 {
     if (filter) {
-        VIR_FREE(filter->name);
-        VIR_FREE(filter->unicast.table);
-        VIR_FREE(filter->multicast.table);
-        VIR_FREE(filter->vlan.table);
-        VIR_FREE(filter);
+        g_free(filter->name);
+        g_free(filter->unicast.table);
+        g_free(filter->multicast.table);
+        g_free(filter->vlan.table);
+        g_free(filter);
     }
 }
 
diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c
index c8eb5cfc79..612e8f985c 100644
--- a/src/util/virnetdevbandwidth.c
+++ b/src/util/virnetdevbandwidth.c
@@ -34,9 +34,9 @@ virNetDevBandwidthFree(virNetDevBandwidthPtr def)
     if (!def)
         return;
 
-    VIR_FREE(def->in);
-    VIR_FREE(def->out);
-    VIR_FREE(def);
+    g_free(def->in);
+    g_free(def->out);
+    g_free(def);
 }
 
 static void
diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index fc7808cbaa..4eb8ef76d1 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -775,8 +775,8 @@ virNetDevIPRouteFree(virNetDevIPRoutePtr def)
 {
     if (!def)
         return;
-    VIR_FREE(def->family);
-    VIR_FREE(def);
+    g_free(def->family);
+    g_free(def);
 }
 
 virSocketAddrPtr
@@ -913,5 +913,5 @@ virNetDevIPInfoAddToDev(const char *ifname,
 void
 virNetDevIPAddrFree(virNetDevIPAddrPtr ip)
 {
-    VIR_FREE(ip);
+    g_free(ip);
 }
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index 2deefe6589..ed677193af 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -563,11 +563,11 @@ static void
 virNetlinkCallbackDataFree(virNetlinkCallbackDataPtr calld)
 {
     if (calld) {
-        VIR_FREE(calld->cr_ifname);
-        VIR_FREE(calld->virtPortProfile);
-        VIR_FREE(calld->linkdev);
+        g_free(calld->cr_ifname);
+        g_free(calld->virtPortProfile);
+        g_free(calld->linkdev);
     }
-    VIR_FREE(calld);
+    g_free(calld);
 }
 
 /**
diff --git a/src/util/virnetdevvlan.c b/src/util/virnetdevvlan.c
index 154d92497c..339290fe79 100644
--- a/src/util/virnetdevvlan.c
+++ b/src/util/virnetdevvlan.c
@@ -39,7 +39,7 @@ virNetDevVlanFree(virNetDevVlanPtr vlan)
 {
     if (vlan)
         virNetDevVlanClear(vlan);
-    VIR_FREE(vlan);
+    g_free(vlan);
 }
 
 int
diff --git a/src/util/virnvme.c b/src/util/virnvme.c
index 66b73cd1d1..af297552c1 100644
--- a/src/util/virnvme.c
+++ b/src/util/virnvme.c
@@ -86,7 +86,7 @@ virNVMeDeviceFree(virNVMeDevicePtr dev)
         return;
 
     virNVMeDeviceUsedByClear(dev);
-    VIR_FREE(dev);
+    g_free(dev);
 }
 
 
diff --git a/src/util/virobject.c b/src/util/virobject.c
index a6305354c3..ce40ffae22 100644
--- a/src/util/virobject.c
+++ b/src/util/virobject.c
@@ -632,7 +632,7 @@ virObjectListFree(void *list)
     for (next = (void **) list; *next; next++)
         virObjectUnref(*next);
 
-    VIR_FREE(list);
+    g_free(list);
 }
 
 
diff --git a/src/util/virpci.c b/src/util/virpci.c
index ce6b132688..b8e8422aa0 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -1520,11 +1520,11 @@ virPCIDeviceFree(virPCIDevicePtr dev)
     if (!dev)
         return;
     VIR_DEBUG("%s %s: freeing", dev->id, dev->name);
-    VIR_FREE(dev->name);
-    VIR_FREE(dev->path);
-    VIR_FREE(dev->used_by_drvname);
-    VIR_FREE(dev->used_by_domname);
-    VIR_FREE(dev);
+    g_free(dev->name);
+    g_free(dev->path);
+    g_free(dev->used_by_drvname);
+    g_free(dev->used_by_domname);
+    g_free(dev);
 }
 
 /**
@@ -2819,13 +2819,13 @@ virPCIEDeviceInfoFree(virPCIEDeviceInfoPtr dev)
     if (!dev)
         return;
 
-    VIR_FREE(dev->link_cap);
-    VIR_FREE(dev->link_sta);
-    VIR_FREE(dev);
+    g_free(dev->link_cap);
+    g_free(dev->link_sta);
+    g_free(dev);
 }
 
 void
 virPCIDeviceAddressFree(virPCIDeviceAddressPtr address)
 {
-    VIR_FREE(address);
+    g_free(address);
 }
diff --git a/src/util/virperf.c b/src/util/virperf.c
index 7f260d2da6..f6b9a3824b 100644
--- a/src/util/virperf.c
+++ b/src/util/virperf.c
@@ -394,5 +394,5 @@ virPerfFree(virPerfPtr perf)
             virPerfEventDisable(perf, i);
     }
 
-    VIR_FREE(perf);
+    g_free(perf);
 }
diff --git a/src/util/virportallocator.c b/src/util/virportallocator.c
index 76c6e43726..d694d53b5e 100644
--- a/src/util/virportallocator.c
+++ b/src/util/virportallocator.c
@@ -117,8 +117,8 @@ virPortAllocatorRangeFree(virPortAllocatorRangePtr range)
     if (!range)
         return;
 
-    VIR_FREE(range->name);
-    VIR_FREE(range);
+    g_free(range->name);
+    g_free(range);
 }
 
 static int
diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
index 67a921b44b..4ee95aa232 100644
--- a/src/util/virresctrl.c
+++ b/src/util/virresctrl.c
@@ -232,7 +232,7 @@ virResctrlInfoMonFree(virResctrlInfoMonPtr mon)
         return;
 
     g_strfreev(mon->features);
-    VIR_FREE(mon);
+    g_free(mon);
 }
 
 
@@ -2752,6 +2752,6 @@ virResctrlMonitorStatsFree(virResctrlMonitorStatsPtr stat)
         return;
 
     g_strfreev(stat->features);
-    VIR_FREE(stat->vals);
-    VIR_FREE(stat);
+    g_free(stat->vals);
+    g_free(stat);
 }
diff --git a/src/util/virrotatingfile.c b/src/util/virrotatingfile.c
index 9f1ef17c3e..718578765f 100644
--- a/src/util/virrotatingfile.c
+++ b/src/util/virrotatingfile.c
@@ -80,7 +80,7 @@ virRotatingFileWriterEntryFree(virRotatingFileWriterEntryPtr entry)
         return;
 
     VIR_FORCE_CLOSE(entry->fd);
-    VIR_FREE(entry);
+    g_free(entry);
 }
 
 
@@ -90,9 +90,9 @@ virRotatingFileReaderEntryFree(virRotatingFileReaderEntryPtr entry)
     if (!entry)
         return;
 
-    VIR_FREE(entry->path);
+    g_free(entry->path);
     VIR_FORCE_CLOSE(entry->fd);
-    VIR_FREE(entry);
+    g_free(entry);
 }
 
 
@@ -610,8 +610,8 @@ virRotatingFileWriterFree(virRotatingFileWriterPtr file)
         return;
 
     virRotatingFileWriterEntryFree(file->entry);
-    VIR_FREE(file->basepath);
-    VIR_FREE(file);
+    g_free(file->basepath);
+    g_free(file);
 }
 
 
@@ -631,6 +631,6 @@ virRotatingFileReaderFree(virRotatingFileReaderPtr file)
 
     for (i = 0; i < file->nentries; i++)
         virRotatingFileReaderEntryFree(file->entries[i]);
-    VIR_FREE(file->entries);
-    VIR_FREE(file);
+    g_free(file->entries);
+    g_free(file);
 }
diff --git a/src/util/virscsi.c b/src/util/virscsi.c
index 22d4679368..0c753c075e 100644
--- a/src/util/virscsi.c
+++ b/src/util/virscsi.c
@@ -222,9 +222,9 @@ virSCSIDeviceNew(const char *sysfs_prefix,
 static void
 virSCSIDeviceUsedByInfoFree(virUsedByInfoPtr used_by)
 {
-    VIR_FREE(used_by->drvname);
-    VIR_FREE(used_by->domname);
-    VIR_FREE(used_by);
+    g_free(used_by->drvname);
+    g_free(used_by->domname);
+    g_free(used_by);
 }
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virUsedByInfo, virSCSIDeviceUsedByInfoFree);
 
@@ -236,13 +236,13 @@ virSCSIDeviceFree(virSCSIDevicePtr dev)
     if (!dev)
         return;
 
-    VIR_FREE(dev->id);
-    VIR_FREE(dev->name);
-    VIR_FREE(dev->sg_path);
+    g_free(dev->id);
+    g_free(dev->name);
+    g_free(dev->sg_path);
     for (i = 0; i < dev->n_used_by; i++)
         virSCSIDeviceUsedByInfoFree(dev->used_by[i]);
-    VIR_FREE(dev->used_by);
-    VIR_FREE(dev);
+    g_free(dev->used_by);
+    g_free(dev);
 }
 
 int
diff --git a/src/util/virscsivhost.c b/src/util/virscsivhost.c
index a2bf9a446f..5907edbc7e 100644
--- a/src/util/virscsivhost.c
+++ b/src/util/virscsivhost.c
@@ -268,9 +268,9 @@ virSCSIVHostDeviceFree(virSCSIVHostDevicePtr dev)
     if (!dev)
         return;
     VIR_DEBUG("%s: freeing", dev->name);
-    VIR_FREE(dev->name);
-    VIR_FREE(dev->path);
-    VIR_FREE(dev->used_by_drvname);
-    VIR_FREE(dev->used_by_domname);
-    VIR_FREE(dev);
+    g_free(dev->name);
+    g_free(dev->path);
+    g_free(dev->used_by_drvname);
+    g_free(dev->used_by_domname);
+    g_free(dev);
 }
diff --git a/src/util/virseclabel.c b/src/util/virseclabel.c
index 174f344a8b..3dc2b74a9c 100644
--- a/src/util/virseclabel.c
+++ b/src/util/virseclabel.c
@@ -34,11 +34,11 @@ virSecurityLabelDefFree(virSecurityLabelDefPtr def)
 {
     if (!def)
         return;
-    VIR_FREE(def->model);
-    VIR_FREE(def->label);
-    VIR_FREE(def->imagelabel);
-    VIR_FREE(def->baselabel);
-    VIR_FREE(def);
+    g_free(def->model);
+    g_free(def->label);
+    g_free(def->imagelabel);
+    g_free(def->baselabel);
+    g_free(def);
 }
 
 
@@ -47,9 +47,9 @@ virSecurityDeviceLabelDefFree(virSecurityDeviceLabelDefPtr def)
 {
     if (!def)
         return;
-    VIR_FREE(def->model);
-    VIR_FREE(def->label);
-    VIR_FREE(def);
+    g_free(def->model);
+    g_free(def->label);
+    g_free(def);
 }
 
 
diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c
index 65aaa632c7..8ac0ab5f5a 100644
--- a/src/util/virsocketaddr.c
+++ b/src/util/virsocketaddr.c
@@ -1307,5 +1307,5 @@ virSocketAddrPTRDomain(const virSocketAddr *addr,
 void
 virSocketAddrFree(virSocketAddrPtr addr)
 {
-    VIR_FREE(addr);
+    g_free(addr);
 }
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index 28f7104145..995650334c 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -68,11 +68,11 @@ void virSysinfoBIOSDefFree(virSysinfoBIOSDefPtr def)
     if (def == NULL)
         return;
 
-    VIR_FREE(def->vendor);
-    VIR_FREE(def->version);
-    VIR_FREE(def->date);
-    VIR_FREE(def->release);
-    VIR_FREE(def);
+    g_free(def->vendor);
+    g_free(def->version);
+    g_free(def->date);
+    g_free(def->release);
+    g_free(def);
 }
 
 void virSysinfoSystemDefFree(virSysinfoSystemDefPtr def)
@@ -80,14 +80,14 @@ void virSysinfoSystemDefFree(virSysinfoSystemDefPtr def)
     if (def == NULL)
         return;
 
-    VIR_FREE(def->manufacturer);
-    VIR_FREE(def->product);
-    VIR_FREE(def->version);
-    VIR_FREE(def->serial);
-    VIR_FREE(def->uuid);
-    VIR_FREE(def->sku);
-    VIR_FREE(def->family);
-    VIR_FREE(def);
+    g_free(def->manufacturer);
+    g_free(def->product);
+    g_free(def->version);
+    g_free(def->serial);
+    g_free(def->uuid);
+    g_free(def->sku);
+    g_free(def->family);
+    g_free(def);
 }
 
 void virSysinfoBaseBoardDefClear(virSysinfoBaseBoardDefPtr def)
@@ -109,12 +109,12 @@ void virSysinfoChassisDefFree(virSysinfoChassisDefPtr def)
     if (def == NULL)
         return;
 
-    VIR_FREE(def->manufacturer);
-    VIR_FREE(def->version);
-    VIR_FREE(def->serial);
-    VIR_FREE(def->asset);
-    VIR_FREE(def->sku);
-    VIR_FREE(def);
+    g_free(def->manufacturer);
+    g_free(def->version);
+    g_free(def->serial);
+    g_free(def->asset);
+    g_free(def->sku);
+    g_free(def);
 }
 
 
@@ -126,10 +126,10 @@ void virSysinfoOEMStringsDefFree(virSysinfoOEMStringsDefPtr def)
         return;
 
     for (i = 0; i < def->nvalues; i++)
-        VIR_FREE(def->values[i]);
-    VIR_FREE(def->values);
+        g_free(def->values[i]);
+    g_free(def->values);
 
-    VIR_FREE(def);
+    g_free(def);
 }
 
 
@@ -164,45 +164,45 @@ void virSysinfoDefFree(virSysinfoDefPtr def)
 
     for (i = 0; i < def->nbaseBoard; i++)
         virSysinfoBaseBoardDefClear(def->baseBoard + i);
-    VIR_FREE(def->baseBoard);
+    g_free(def->baseBoard);
 
     virSysinfoChassisDefFree(def->chassis);
 
     for (i = 0; i < def->nprocessor; i++) {
-        VIR_FREE(def->processor[i].processor_socket_destination);
-        VIR_FREE(def->processor[i].processor_type);
-        VIR_FREE(def->processor[i].processor_family);
-        VIR_FREE(def->processor[i].processor_manufacturer);
-        VIR_FREE(def->processor[i].processor_signature);
-        VIR_FREE(def->processor[i].processor_version);
-        VIR_FREE(def->processor[i].processor_external_clock);
-        VIR_FREE(def->processor[i].processor_max_speed);
-        VIR_FREE(def->processor[i].processor_status);
-        VIR_FREE(def->processor[i].processor_serial_number);
-        VIR_FREE(def->processor[i].processor_part_number);
+        g_free(def->processor[i].processor_socket_destination);
+        g_free(def->processor[i].processor_type);
+        g_free(def->processor[i].processor_family);
+        g_free(def->processor[i].processor_manufacturer);
+        g_free(def->processor[i].processor_signature);
+        g_free(def->processor[i].processor_version);
+        g_free(def->processor[i].processor_external_clock);
+        g_free(def->processor[i].processor_max_speed);
+        g_free(def->processor[i].processor_status);
+        g_free(def->processor[i].processor_serial_number);
+        g_free(def->processor[i].processor_part_number);
     }
-    VIR_FREE(def->processor);
+    g_free(def->processor);
     for (i = 0; i < def->nmemory; i++) {
-        VIR_FREE(def->memory[i].memory_size);
-        VIR_FREE(def->memory[i].memory_form_factor);
-        VIR_FREE(def->memory[i].memory_locator);
-        VIR_FREE(def->memory[i].memory_bank_locator);
-        VIR_FREE(def->memory[i].memory_type);
-        VIR_FREE(def->memory[i].memory_type_detail);
-        VIR_FREE(def->memory[i].memory_speed);
-        VIR_FREE(def->memory[i].memory_manufacturer);
-        VIR_FREE(def->memory[i].memory_serial_number);
-        VIR_FREE(def->memory[i].memory_part_number);
+        g_free(def->memory[i].memory_size);
+        g_free(def->memory[i].memory_form_factor);
+        g_free(def->memory[i].memory_locator);
+        g_free(def->memory[i].memory_bank_locator);
+        g_free(def->memory[i].memory_type);
+        g_free(def->memory[i].memory_type_detail);
+        g_free(def->memory[i].memory_speed);
+        g_free(def->memory[i].memory_manufacturer);
+        g_free(def->memory[i].memory_serial_number);
+        g_free(def->memory[i].memory_part_number);
     }
-    VIR_FREE(def->memory);
+    g_free(def->memory);
 
     virSysinfoOEMStringsDefFree(def->oemStrings);
 
     for (i = 0; i < def->nfw_cfgs; i++)
         virSysinfoFWCfgDefClear(&def->fw_cfgs[i]);
-    VIR_FREE(def->fw_cfgs);
+    g_free(def->fw_cfgs);
 
-    VIR_FREE(def);
+    g_free(def);
 }
 
 
diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index edd29f0fdd..3f689365e4 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -640,8 +640,8 @@ virSystemdActivationEntryFree(void *data)
         VIR_FORCE_CLOSE(ent->fds[i]);
     }
 
-    VIR_FREE(ent->fds);
-    VIR_FREE(ent);
+    g_free(ent->fds);
+    g_free(ent);
 }
 
 
@@ -1048,5 +1048,5 @@ virSystemdActivationFree(virSystemdActivationPtr act)
 
     virHashFree(act->fds);
 
-    VIR_FREE(act);
+    g_free(act);
 }
diff --git a/src/util/virthreadpool.c b/src/util/virthreadpool.c
index 3942633431..942cfa48b1 100644
--- a/src/util/virthreadpool.c
+++ b/src/util/virthreadpool.c
@@ -305,14 +305,14 @@ void virThreadPoolFree(virThreadPoolPtr pool)
     virMutexLock(&pool->mutex);
     virThreadPoolDrainLocked(pool);
 
-    VIR_FREE(pool->workers);
+    g_free(pool->workers);
     virMutexUnlock(&pool->mutex);
     virMutexDestroy(&pool->mutex);
     virCondDestroy(&pool->quit_cond);
     virCondDestroy(&pool->cond);
-    VIR_FREE(pool->prioWorkers);
+    g_free(pool->prioWorkers);
     virCondDestroy(&pool->prioCond);
-    VIR_FREE(pool);
+    g_free(pool);
 }
 
 
diff --git a/src/util/virtypedparam-public.c b/src/util/virtypedparam-public.c
index 0ddb618dbf..91603cfe1c 100644
--- a/src/util/virtypedparam-public.c
+++ b/src/util/virtypedparam-public.c
@@ -880,5 +880,5 @@ virTypedParamsFree(virTypedParameterPtr params,
                    int nparams)
 {
     virTypedParamsClear(params, nparams);
-    VIR_FREE(params);
+    g_free(params);
 }
diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
index 43af4a7c56..f9ab6f6042 100644
--- a/src/util/virtypedparam.c
+++ b/src/util/virtypedparam.c
@@ -485,11 +485,11 @@ virTypedParamsRemoteFree(virTypedParameterRemotePtr remote_params_val,
         return;
 
     for (i = 0; i < remote_params_len; i++) {
-        VIR_FREE(remote_params_val[i].field);
+        g_free(remote_params_val[i].field);
         if (remote_params_val[i].value.type == VIR_TYPED_PARAM_STRING)
-            VIR_FREE(remote_params_val[i].value.remote_typed_param_value.s);
+            g_free(remote_params_val[i].value.remote_typed_param_value.s);
     }
-    VIR_FREE(remote_params_val);
+    g_free(remote_params_val);
 }
 
 
@@ -724,7 +724,7 @@ virTypedParamListFree(virTypedParamListPtr list)
         return;
 
     virTypedParamsFree(list->par, list->npar);
-    VIR_FREE(list);
+    g_free(list);
 }
 
 
diff --git a/src/util/viruri.c b/src/util/viruri.c
index ef5ab363d6..0aafd49d6d 100644
--- a/src/util/viruri.c
+++ b/src/util/viruri.c
@@ -279,20 +279,20 @@ void virURIFree(virURIPtr uri)
     if (!uri)
         return;
 
-    VIR_FREE(uri->scheme);
-    VIR_FREE(uri->server);
-    VIR_FREE(uri->user);
-    VIR_FREE(uri->path);
-    VIR_FREE(uri->query);
-    VIR_FREE(uri->fragment);
+    g_free(uri->scheme);
+    g_free(uri->server);
+    g_free(uri->user);
+    g_free(uri->path);
+    g_free(uri->query);
+    g_free(uri->fragment);
 
     for (i = 0; i < uri->paramsCount; i++) {
-        VIR_FREE(uri->params[i].name);
-        VIR_FREE(uri->params[i].value);
+        g_free(uri->params[i].name);
+        g_free(uri->params[i].value);
     }
-    VIR_FREE(uri->params);
+    g_free(uri->params);
 
-    VIR_FREE(uri);
+    g_free(uri);
 }
 
 
diff --git a/src/util/virusb.c b/src/util/virusb.c
index a8afd6e6f0..ae400de656 100644
--- a/src/util/virusb.c
+++ b/src/util/virusb.c
@@ -354,10 +354,10 @@ virUSBDeviceFree(virUSBDevicePtr dev)
     if (!dev)
         return;
     VIR_DEBUG("%s %s: freeing", dev->id, dev->name);
-    VIR_FREE(dev->path);
-    VIR_FREE(dev->used_by_drvname);
-    VIR_FREE(dev->used_by_domname);
-    VIR_FREE(dev);
+    g_free(dev->path);
+    g_free(dev->used_by_drvname);
+    g_free(dev->used_by_domname);
+    g_free(dev);
 }
 
 int
diff --git a/src/util/virxml.c b/src/util/virxml.c
index 7df50e4b4d..0354251941 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -1312,12 +1312,12 @@ virXMLValidatorFree(virXMLValidatorPtr validator)
     if (!validator)
         return;
 
-    VIR_FREE(validator->schemafile);
+    g_free(validator->schemafile);
     virBufferFreeAndReset(&validator->buf);
     xmlRelaxNGFreeParserCtxt(validator->rngParser);
     xmlRelaxNGFreeValidCtxt(validator->rngValid);
     xmlRelaxNGFree(validator->rng);
-    VIR_FREE(validator);
+    g_free(validator);
 }
 
 
-- 
2.29.2




[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