Since commit 44e7f029159ed701b4a1739ac711507ee53790ed
util: rewrite auto cleanup macros to use glib's equivalent
VIR_AUTOPTR aliases to g_autoptr. Replace all uses of VIR_DEFINE_AUTOPTR_FUNC
with G_DEFINE_AUTOPTR_CLEANUP_FUNC in preparation for replacing the
rest.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/conf/domain_capabilities.h | 2 +-
src/conf/domain_conf.h | 2 +-
src/conf/secret_conf.h | 2 +-
src/conf/storage_conf.h | 6 +++---
src/conf/virnetworkportdef.h | 2 +-
src/qemu/qemu_block.c | 2 +-
src/qemu/qemu_block.h | 4 ++--
src/qemu/qemu_dbus.h | 2 +-
src/qemu/qemu_firmware.c | 6 +++---
src/qemu/qemu_firmware.h | 2 +-
src/qemu/qemu_migration_params.h | 2 +-
src/qemu/qemu_monitor.h | 2 +-
src/qemu/qemu_slirp.h | 2 +-
src/qemu/qemu_vhost_user.c | 2 +-
src/qemu/qemu_vhost_user.h | 2 +-
src/util/virauthconfig.h | 2 +-
src/util/virbitmap.h | 2 +-
src/util/vircommand.h | 2 +-
src/util/virconf.h | 2 +-
src/util/virerror.h | 2 +-
src/util/virfile.h | 2 +-
src/util/virfirewall.h | 2 +-
src/util/virfirmware.h | 2 +-
src/util/virhash.h | 2 +-
src/util/virjson.h | 2 +-
src/util/virmacaddr.h | 2 +-
src/util/virmdev.h | 4 ++--
src/util/virnetdev.c | 2 +-
src/util/virnetdev.h | 2 +-
src/util/virnetdevip.h | 4 ++--
src/util/virnetdevvlan.h | 2 +-
src/util/virnetlink.c | 2 +-
src/util/virnetlink.h | 2 +-
src/util/virpci.h | 6 +++---
src/util/virperf.h | 2 +-
src/util/virscsi.c | 2 +-
src/util/virscsi.h | 2 +-
src/util/virscsivhost.h | 2 +-
src/util/virsocketaddr.h | 2 +-
src/util/virstoragefile.h | 2 +-
src/util/virsystemd.h | 2 +-
src/util/virtypedparam.h | 2 +-
src/util/viruri.h | 2 +-
src/util/virusb.h | 2 +-
src/util/virxml.h | 4 ++--
tests/qemumonitortestutils.h | 2 +-
tools/virsh-util.h | 2 +-
47 files changed, 57 insertions(+), 57 deletions(-)
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index 3a92194602..b5c322fd90 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -236,4 +236,4 @@ int virDomainCapsDeviceDefValidate(virDomainCapsPtr const caps,
void
virSEVCapabilitiesFree(virSEVCapability *capabilities);
-VIR_DEFINE_AUTOPTR_FUNC(virSEVCapability, virSEVCapabilitiesFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSEVCapability, virSEVCapabilitiesFree);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index e2edca149a..edac6250e4 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2913,7 +2913,7 @@ bool virDomainDefHasDeviceAddress(virDomainDefPtr def,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
void virDomainDefFree(virDomainDefPtr vm);
-VIR_DEFINE_AUTOPTR_FUNC(virDomainDef, virDomainDefFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainDef, virDomainDefFree);
virDomainChrSourceDefPtr
virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt);
diff --git a/src/conf/secret_conf.h b/src/conf/secret_conf.h
index 7cfcfc8a60..ac94751ef3 100644
--- a/src/conf/secret_conf.h
+++ b/src/conf/secret_conf.h
@@ -35,7 +35,7 @@ struct _virSecretDef {
};
void virSecretDefFree(virSecretDefPtr def);
-VIR_DEFINE_AUTOPTR_FUNC(virSecretDef, virSecretDefFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSecretDef, virSecretDefFree);
virSecretDefPtr virSecretDefParseString(const char *xml);
virSecretDefPtr virSecretDefParseFile(const char *filename);
diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h
index 1f62803a9d..b172e82ccb 100644
--- a/src/conf/storage_conf.h
+++ b/src/conf/storage_conf.h
@@ -478,6 +478,6 @@ VIR_ENUM_DECL(virStoragePartedFs);
VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART | \
VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE)
-VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolSource, virStoragePoolSourceFree);
-VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolDef, virStoragePoolDefFree);
-VIR_DEFINE_AUTOPTR_FUNC(virStorageVolDef, virStorageVolDefFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStoragePoolSource, virStoragePoolSourceFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStoragePoolDef, virStoragePoolDefFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageVolDef, virStorageVolDefFree);
diff --git a/src/conf/virnetworkportdef.h b/src/conf/virnetworkportdef.h
index 796e269fe0..f5ba337fc9 100644
--- a/src/conf/virnetworkportdef.h
+++ b/src/conf/virnetworkportdef.h
@@ -82,7 +82,7 @@ struct _virNetworkPortDef {
void
virNetworkPortDefFree(virNetworkPortDefPtr port);
-VIR_DEFINE_AUTOPTR_FUNC(virNetworkPortDef, virNetworkPortDefFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkPortDef, virNetworkPortDefFree);
virNetworkPortDefPtr
virNetworkPortDefParseNode(xmlDocPtr xml,
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 17e2ccc98f..9a13351d2f 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -87,7 +87,7 @@
qemuBlockNodeNameBackingChainDataFree(qemuBlockNodeNameBackingChainDataPtr data)
VIR_FREE(data);
}
-VIR_DEFINE_AUTOPTR_FUNC(qemuBlockNodeNameBackingChainData,
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockNodeNameBackingChainData,
qemuBlockNodeNameBackingChainDataFree);
diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h
index 87525af160..be39c9b472 100644
--- a/src/qemu/qemu_block.h
+++ b/src/qemu/qemu_block.h
@@ -104,7 +104,7 @@ struct qemuBlockStorageSourceAttachData {
void
qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data);
-VIR_DEFINE_AUTOPTR_FUNC(qemuBlockStorageSourceAttachData,
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockStorageSourceAttachData,
qemuBlockStorageSourceAttachDataFree);
qemuBlockStorageSourceAttachDataPtr
@@ -156,7 +156,7 @@ qemuBlockStorageSourceChainDetach(qemuMonitorPtr mon,
qemuBlockStorageSourceChainDataPtr data);
-VIR_DEFINE_AUTOPTR_FUNC(qemuBlockStorageSourceChainData,
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockStorageSourceChainData,
qemuBlockStorageSourceChainDataFree);
int
diff --git a/src/qemu/qemu_dbus.h b/src/qemu/qemu_dbus.h
index 48ea71f7aa..ccbeb83709 100644
--- a/src/qemu/qemu_dbus.h
+++ b/src/qemu/qemu_dbus.h
@@ -39,4 +39,4 @@ int qemuDBusVMStateAdd(virQEMUDriverPtr driver, virDomainObjPtr vm,
void qemuDBusVMStateRemove(virQEMUDriverPtr driver, virDomainObjPtr vm,
const char *id, bool hot);
-VIR_DEFINE_AUTOPTR_FUNC(qemuDBusVMState, qemuDBusVMStateFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDBusVMState, qemuDBusVMStateFree);
diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c
index d043b46e6c..10644a0e28 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -186,7 +186,7 @@ qemuFirmwareOSInterfaceFree(qemuFirmwareOSInterface *interfaces)
}
-VIR_DEFINE_AUTOPTR_FUNC(qemuFirmwareOSInterface, qemuFirmwareOSInterfaceFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmwareOSInterface, qemuFirmwareOSInterfaceFree);
static void
@@ -251,7 +251,7 @@ qemuFirmwareTargetFree(qemuFirmwareTargetPtr target)
}
-VIR_DEFINE_AUTOPTR_FUNC(qemuFirmwareTarget, qemuFirmwareTargetFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmwareTarget, qemuFirmwareTargetFree);
static void
@@ -261,7 +261,7 @@ qemuFirmwareFeatureFree(qemuFirmwareFeature *features)
}
-VIR_DEFINE_AUTOPTR_FUNC(qemuFirmwareFeature, qemuFirmwareFeatureFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmwareFeature, qemuFirmwareFeatureFree);
void
diff --git a/src/qemu/qemu_firmware.h b/src/qemu/qemu_firmware.h
index 28e8322ec9..10b8eb822b 100644
--- a/src/qemu/qemu_firmware.h
+++ b/src/qemu/qemu_firmware.h
@@ -32,7 +32,7 @@ typedef qemuFirmware *qemuFirmwarePtr;
void
qemuFirmwareFree(qemuFirmwarePtr fw);
-VIR_DEFINE_AUTOPTR_FUNC(qemuFirmware, qemuFirmwareFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmware, qemuFirmwareFree);
qemuFirmwarePtr
qemuFirmwareParse(const char *path);
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index 6f5080e6a7..e8380e6fb1 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -93,7 +93,7 @@ qemuMigrationParamsNew(void);
void
qemuMigrationParamsFree(qemuMigrationParamsPtr migParams);
-VIR_DEFINE_AUTOPTR_FUNC(qemuMigrationParams, qemuMigrationParamsFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationParams, qemuMigrationParamsFree);
int
qemuMigrationParamsApply(virQEMUDriverPtr driver,
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 536ba7893b..11048dc76a 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1343,7 +1343,7 @@ int qemuMonitorGetCurrentMachineInfo(qemuMonitorPtr mon,
qemuMonitorCurrentMachineInfoPtr info);
void qemuMonitorJobInfoFree(qemuMonitorJobInfoPtr job);
-VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorJobInfo, qemuMonitorJobInfoFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorJobInfo, qemuMonitorJobInfoFree);
int qemuMonitorGetJobInfo(qemuMonitorPtr mon,
qemuMonitorJobInfoPtr **jobs,
diff --git a/src/qemu/qemu_slirp.h b/src/qemu/qemu_slirp.h
index cda1ed7777..5e80e79b15 100644
--- a/src/qemu/qemu_slirp.h
+++ b/src/qemu/qemu_slirp.h
@@ -77,4 +77,4 @@ void qemuSlirpStop(qemuSlirpPtr slirp,
int qemuSlirpGetFD(qemuSlirpPtr slirp);
-VIR_DEFINE_AUTOPTR_FUNC(qemuSlirp, qemuSlirpFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuSlirp, qemuSlirpFree);
diff --git a/src/qemu/qemu_vhost_user.c b/src/qemu/qemu_vhost_user.c
index d1dbc3bd5c..8a653fc101 100644
--- a/src/qemu/qemu_vhost_user.c
+++ b/src/qemu/qemu_vhost_user.c
@@ -116,7 +116,7 @@ qemuVhostUserGPUFeatureFree(qemuVhostUserGPUFeature *features)
}
-VIR_DEFINE_AUTOPTR_FUNC(qemuVhostUserGPUFeature, qemuVhostUserGPUFeatureFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuVhostUserGPUFeature, qemuVhostUserGPUFeatureFree);
void
diff --git a/src/qemu/qemu_vhost_user.h b/src/qemu/qemu_vhost_user.h
index 76701dd1fa..6bb5f5807c 100644
--- a/src/qemu/qemu_vhost_user.h
+++ b/src/qemu/qemu_vhost_user.h
@@ -31,7 +31,7 @@ typedef qemuVhostUser *qemuVhostUserPtr;
void
qemuVhostUserFree(qemuVhostUserPtr fw);
-VIR_DEFINE_AUTOPTR_FUNC(qemuVhostUser, qemuVhostUserFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuVhostUser, qemuVhostUserFree);
qemuVhostUserPtr
qemuVhostUserParse(const char *path);
diff --git a/src/util/virauthconfig.h b/src/util/virauthconfig.h
index 3de5e36030..44bef7e2be 100644
--- a/src/util/virauthconfig.h
+++ b/src/util/virauthconfig.h
@@ -40,4 +40,4 @@ int virAuthConfigLookup(virAuthConfigPtr auth,
const char *credname,
const char **value);
-VIR_DEFINE_AUTOPTR_FUNC(virAuthConfig, virAuthConfigFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virAuthConfig, virAuthConfigFree);
diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h
index 8d700c88c5..e0c5541c13 100644
--- a/src/util/virbitmap.h
+++ b/src/util/virbitmap.h
@@ -157,4 +157,4 @@ void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b)
void virBitmapShrink(virBitmapPtr map, size_t b);
-VIR_DEFINE_AUTOPTR_FUNC(virBitmap, virBitmapFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virBitmap, virBitmapFree);
diff --git a/src/util/vircommand.h b/src/util/vircommand.h
index ed04eb4bd3..2f39dec1b3 100644
--- a/src/util/vircommand.h
+++ b/src/util/vircommand.h
@@ -219,4 +219,4 @@ int virCommandRunNul(virCommandPtr cmd,
virCommandRunNulFunc func,
void *data);
-VIR_DEFINE_AUTOPTR_FUNC(virCommand, virCommandFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCommand, virCommandFree);
diff --git a/src/util/virconf.h b/src/util/virconf.h
index 4c0c633aad..304b325985 100644
--- a/src/util/virconf.h
+++ b/src/util/virconf.h
@@ -81,7 +81,7 @@ virConfPtr virConfReadFile(const char *filename, unsigned int flags);
virConfPtr virConfReadString(const char *memory,
unsigned int flags);
int virConfFree(virConfPtr conf);
-VIR_DEFINE_AUTOPTR_FUNC(virConf, virConfFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virConf, virConfFree);
void virConfFreeValue(virConfValuePtr val);
virConfValuePtr virConfGetValue(virConfPtr conf,
const char *setting);
diff --git a/src/util/virerror.h b/src/util/virerror.h
index e3a08982b3..7e5ed29ae2 100644
--- a/src/util/virerror.h
+++ b/src/util/virerror.h
@@ -209,4 +209,4 @@ void virErrorRestore(virErrorPtr *savederr);
void virLastErrorPrefixMessage(const char *fmt, ...)
G_GNUC_PRINTF(1, 2);
-VIR_DEFINE_AUTOPTR_FUNC(virError, virFreeError);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virError, virFreeError);
diff --git a/src/util/virfile.h b/src/util/virfile.h
index a60b2bef9a..b8256a96b3 100644
--- a/src/util/virfile.h
+++ b/src/util/virfile.h
@@ -378,7 +378,7 @@ int virFileInData(int fd,
int *inData,
long long *length);
-VIR_DEFINE_AUTOPTR_FUNC(virFileWrapperFd, virFileWrapperFdFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFileWrapperFd, virFileWrapperFdFree);
int virFileGetXAttr(const char *path,
const char *name,
diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h
index 56e78a0672..bcc1437b9a 100644
--- a/src/util/virfirewall.h
+++ b/src/util/virfirewall.h
@@ -114,4 +114,4 @@ int virFirewallApply(virFirewallPtr firewall);
void virFirewallSetLockOverride(bool avoid);
-VIR_DEFINE_AUTOPTR_FUNC(virFirewall, virFirewallFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFirewall, virFirewallFree);
diff --git a/src/util/virfirmware.h b/src/util/virfirmware.h
index 30bcd21fa4..20bb850500 100644
--- a/src/util/virfirmware.h
+++ b/src/util/virfirmware.h
@@ -34,7 +34,7 @@ struct _virFirmware {
void
virFirmwareFree(virFirmwarePtr firmware);
-VIR_DEFINE_AUTOPTR_FUNC(virFirmware, virFirmwareFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFirmware, virFirmwareFree);
void
virFirmwareFreeList(virFirmwarePtr *firmwares, size_t nfirmwares);
diff --git a/src/util/virhash.h b/src/util/virhash.h
index ed3774e693..5bb59376af 100644
--- a/src/util/virhash.h
+++ b/src/util/virhash.h
@@ -195,4 +195,4 @@ void *virHashSearch(const virHashTable *table, virHashSearcher iter,
/* Convenience for when VIR_FREE(value) is sufficient as a data freer. */
void virHashValueFree(void *value, const void *name);
-VIR_DEFINE_AUTOPTR_FUNC(virHashTable, virHashFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virHashTable, virHashFree);
diff --git a/src/util/virjson.h b/src/util/virjson.h
index b1d0d0e741..1ce7b75e3b 100644
--- a/src/util/virjson.h
+++ b/src/util/virjson.h
@@ -163,4 +163,4 @@ char *virJSONStringReformat(const char *jsonstr, bool pretty);
virJSONValuePtr virJSONValueObjectDeflatten(virJSONValuePtr json);
-VIR_DEFINE_AUTOPTR_FUNC(virJSONValue, virJSONValueFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virJSONValue, virJSONValueFree);
diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h
index 843893d759..2fda2b0239 100644
--- a/src/util/virmacaddr.h
+++ b/src/util/virmacaddr.h
@@ -63,4 +63,4 @@ bool virMacAddrIsMulticast(const virMacAddr *addr);
bool virMacAddrIsBroadcastRaw(const unsigned char s[VIR_MAC_BUFLEN]);
void virMacAddrFree(virMacAddrPtr addr);
-VIR_DEFINE_AUTOPTR_FUNC(virMacAddr, virMacAddrFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virMacAddr, virMacAddrFree);
diff --git a/src/util/virmdev.h b/src/util/virmdev.h
index 7f442b571f..2f73b1a530 100644
--- a/src/util/virmdev.h
+++ b/src/util/virmdev.h
@@ -140,5 +140,5 @@ int
virMediatedDeviceTypeReadAttrs(const char *sysfspath,
virMediatedDeviceTypePtr *type);
-VIR_DEFINE_AUTOPTR_FUNC(virMediatedDevice, virMediatedDeviceFree);
-VIR_DEFINE_AUTOPTR_FUNC(virMediatedDeviceType, virMediatedDeviceTypeFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virMediatedDevice, virMediatedDeviceFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virMediatedDeviceType, virMediatedDeviceTypeFree);
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 894ae86a16..e23061dd4c 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -122,7 +122,7 @@ virNetDevMcastEntryFree(virNetDevMcastEntryPtr entry)
VIR_FREE(entry);
}
-VIR_DEFINE_AUTOPTR_FUNC(virNetDevMcastEntry, virNetDevMcastEntryFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevMcastEntry, virNetDevMcastEntryFree);
typedef struct _virNetDevMcastList virNetDevMcastList;
typedef virNetDevMcastList *virNetDevMcastListPtr;
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index 854fddfe77..ea3779bb98 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -311,4 +311,4 @@ int virNetDevSysfsFile(char **pf_sysfs_device_link,
int virNetDevRunEthernetScript(const char *ifname, const char *script)
G_GNUC_NO_INLINE;
-VIR_DEFINE_AUTOPTR_FUNC(virNetDevRxFilter, virNetDevRxFilterFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevRxFilter, virNetDevRxFilterFree);
diff --git a/src/util/virnetdevip.h b/src/util/virnetdevip.h
index 7af94a49d7..59d2d4a044 100644
--- a/src/util/virnetdevip.h
+++ b/src/util/virnetdevip.h
@@ -94,5 +94,5 @@ void virNetDevIPInfoClear(virNetDevIPInfoPtr ip);
int virNetDevIPInfoAddToDev(const char *ifname,
virNetDevIPInfo const *ipInfo);
-VIR_DEFINE_AUTOPTR_FUNC(virNetDevIPAddr, virNetDevIPAddrFree);
-VIR_DEFINE_AUTOPTR_FUNC(virNetDevIPRoute, virNetDevIPRouteFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevIPAddr, virNetDevIPAddrFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevIPRoute, virNetDevIPRouteFree);
diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h
index 87d361a1cf..0e4fd03dcb 100644
--- a/src/util/virnetdevvlan.h
+++ b/src/util/virnetdevvlan.h
@@ -48,4 +48,4 @@ void virNetDevVlanFree(virNetDevVlanPtr vlan);
int virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b);
int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src);
-VIR_DEFINE_AUTOPTR_FUNC(virNetDevVlan, virNetDevVlanFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevVlan, virNetDevVlanFree);
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 901e04845c..34c3f28087 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -64,7 +64,7 @@ typedef struct nl_handle virNetlinkHandle;
typedef struct nl_sock virNetlinkHandle;
# endif
-VIR_DEFINE_AUTOPTR_FUNC(virNetlinkHandle, virNetlinkFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetlinkHandle, virNetlinkFree);
typedef struct _virNetlinkEventSrvPrivate virNetlinkEventSrvPrivate;
typedef virNetlinkEventSrvPrivate *virNetlinkEventSrvPrivatePtr;
diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h
index a7e455769d..5cb6060b3b 100644
--- a/src/util/virnetlink.h
+++ b/src/util/virnetlink.h
@@ -36,7 +36,7 @@
# endif
typedef struct nl_msg virNetlinkMsg;
-VIR_DEFINE_AUTOPTR_FUNC(virNetlinkMsg, nlmsg_free);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetlinkMsg, nlmsg_free);
#else
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 017545424d..4ffe5db2d6 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -274,6 +274,6 @@ ssize_t virPCIGetMdevTypes(const char *sysfspath,
void virPCIDeviceAddressFree(virPCIDeviceAddressPtr address);
-VIR_DEFINE_AUTOPTR_FUNC(virPCIDevice, virPCIDeviceFree);
-VIR_DEFINE_AUTOPTR_FUNC(virPCIDeviceAddress, virPCIDeviceAddressFree);
-VIR_DEFINE_AUTOPTR_FUNC(virPCIEDeviceInfo, virPCIEDeviceInfoFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIDevice, virPCIDeviceFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIDeviceAddress, virPCIDeviceAddressFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIEDeviceInfo, virPCIEDeviceInfoFree);
diff --git a/src/util/virperf.h b/src/util/virperf.h
index 27d04b3ea4..df990109b1 100644
--- a/src/util/virperf.h
+++ b/src/util/virperf.h
@@ -82,4 +82,4 @@ int virPerfReadEvent(virPerfPtr perf,
virPerfEventType type,
uint64_t *value);
-VIR_DEFINE_AUTOPTR_FUNC(virPerf, virPerfFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPerf, virPerfFree);
diff --git a/src/util/virscsi.c b/src/util/virscsi.c
index d2c68644fa..5cae15afd2 100644
--- a/src/util/virscsi.c
+++ b/src/util/virscsi.c
@@ -249,7 +249,7 @@ virSCSIDeviceUsedByInfoFree(virUsedByInfoPtr used_by)
VIR_FREE(used_by->domname);
VIR_FREE(used_by);
}
-VIR_DEFINE_AUTOPTR_FUNC(virUsedByInfo, virSCSIDeviceUsedByInfoFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virUsedByInfo, virSCSIDeviceUsedByInfoFree);
void
virSCSIDeviceFree(virSCSIDevicePtr dev)
diff --git a/src/util/virscsi.h b/src/util/virscsi.h
index cfd6ac7356..3a92366efc 100644
--- a/src/util/virscsi.h
+++ b/src/util/virscsi.h
@@ -95,4 +95,4 @@ void virSCSIDeviceListDel(virSCSIDeviceListPtr list,
virSCSIDevicePtr virSCSIDeviceListFind(virSCSIDeviceListPtr list,
virSCSIDevicePtr dev);
-VIR_DEFINE_AUTOPTR_FUNC(virSCSIDevice, virSCSIDeviceFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSCSIDevice, virSCSIDeviceFree);
diff --git a/src/util/virscsivhost.h b/src/util/virscsivhost.h
index 52f5d2c33f..d3185b14bc 100644
--- a/src/util/virscsivhost.h
+++ b/src/util/virscsivhost.h
@@ -63,4 +63,4 @@ void virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevicePtr dev,
void virSCSIVHostDeviceFree(virSCSIVHostDevicePtr dev);
int virSCSIVHostOpenVhostSCSI(int *vhostfd) G_GNUC_NO_INLINE;
-VIR_DEFINE_AUTOPTR_FUNC(virSCSIVHostDevice, virSCSIVHostDeviceFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSCSIVHostDevice, virSCSIVHostDeviceFree);
diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h
index bb97e6e3a0..6cdf7b7c4f 100644
--- a/src/util/virsocketaddr.h
+++ b/src/util/virsocketaddr.h
@@ -163,4 +163,4 @@ int virSocketAddrPTRDomain(const virSocketAddr *addr,
void virSocketAddrFree(virSocketAddrPtr addr);
-VIR_DEFINE_AUTOPTR_FUNC(virSocketAddr, virSocketAddrFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSocketAddr, virSocketAddrFree);
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index cfee047e6f..545e60ba00 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -552,4 +552,4 @@ void virStorageFileReportBrokenChain(int errcode,
virStorageSourcePtr src,
virStorageSourcePtr parent);
-VIR_DEFINE_AUTOPTR_FUNC(virStorageAuthDef, virStorageAuthDefFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageAuthDef, virStorageAuthDefFree);
diff --git a/src/util/virsystemd.h b/src/util/virsystemd.h
index 2c0a0d8dc0..fcdf6d17fe 100644
--- a/src/util/virsystemd.h
+++ b/src/util/virsystemd.h
@@ -84,4 +84,4 @@ void virSystemdActivationClaimFDs(virSystemdActivationPtr act,
void virSystemdActivationFree(virSystemdActivationPtr act);
-VIR_DEFINE_AUTOPTR_FUNC(virSystemdActivation, virSystemdActivationFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSystemdActivation, virSystemdActivationFree);
diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h
index b35f1f93ef..42a4da466e 100644
--- a/src/util/virtypedparam.h
+++ b/src/util/virtypedparam.h
@@ -140,7 +140,7 @@ struct _virTypedParamList {
};
void virTypedParamListFree(virTypedParamListPtr list);
-VIR_DEFINE_AUTOPTR_FUNC(virTypedParamList, virTypedParamListFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virTypedParamList, virTypedParamListFree);
size_t virTypedParamListStealParams(virTypedParamListPtr list,
virTypedParameterPtr *params);
diff --git a/src/util/viruri.h b/src/util/viruri.h
index e988582bbe..f91debefe9 100644
--- a/src/util/viruri.h
+++ b/src/util/viruri.h
@@ -60,7 +60,7 @@ char *virURIFormat(virURIPtr uri)
char *virURIFormatParams(virURIPtr uri);
void virURIFree(virURIPtr uri);
-VIR_DEFINE_AUTOPTR_FUNC(virURI, virURIFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virURI, virURIFree);
int virURIResolveAlias(virConfPtr conf, const char *alias, char **uri);
#define VIR_URI_SERVER(uri) ((uri) && (uri)->server ? (uri)->server :
"localhost")
diff --git a/src/util/virusb.h b/src/util/virusb.h
index 33ddb6c84e..7ff1d55c9e 100644
--- a/src/util/virusb.h
+++ b/src/util/virusb.h
@@ -98,4 +98,4 @@ void virUSBDeviceListDel(virUSBDeviceListPtr list,
virUSBDevicePtr virUSBDeviceListFind(virUSBDeviceListPtr list,
virUSBDevicePtr dev);
-VIR_DEFINE_AUTOPTR_FUNC(virUSBDevice, virUSBDeviceFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virUSBDevice, virUSBDeviceFree);
diff --git a/src/util/virxml.h b/src/util/virxml.h
index 8813e31f75..283c592b2c 100644
--- a/src/util/virxml.h
+++ b/src/util/virxml.h
@@ -247,8 +247,8 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virXPathContextNodeSave,
virXPathContextNodeRes
.node = _ctxt->node}; \
ignore_value(&_ctxt ## CtxtSave)
-VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc);
-VIR_DEFINE_AUTOPTR_FUNC(xmlXPathContext, xmlXPathFreeContext);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlDoc, xmlFreeDoc);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlXPathContext, xmlXPathFreeContext);
typedef int (*virXMLNamespaceParse)(xmlXPathContextPtr ctxt, void **nsdata);
typedef void (*virXMLNamespaceFree)(void *nsdata);
diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h
index 2333fceed0..f6d7f3623c 100644
--- a/tests/qemumonitortestutils.h
+++ b/tests/qemumonitortestutils.h
@@ -101,4 +101,4 @@ qemuMonitorPtr qemuMonitorTestGetMonitor(qemuMonitorTestPtr test);
qemuAgentPtr qemuMonitorTestGetAgent(qemuMonitorTestPtr test);
virDomainObjPtr qemuMonitorTestGetDomainObj(qemuMonitorTestPtr test);
-VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorTest, qemuMonitorTestFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorTest, qemuMonitorTestFree);
diff --git a/tools/virsh-util.h b/tools/virsh-util.h
index 955d34dcfc..2b0447268e 100644
--- a/tools/virsh-util.h
+++ b/tools/virsh-util.h
@@ -43,7 +43,7 @@ typedef virDomain virshDomain;
void
virshDomainFree(virDomainPtr dom);
-VIR_DEFINE_AUTOPTR_FUNC(virshDomain, virshDomainFree);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virshDomain, virshDomainFree);
void
virshDomainCheckpointFree(virDomainCheckpointPtr chk);
--
2.19.2