提交 8334203f 编写于 作者: J Ján Tomko

Use G_DEFINE_AUTOPTR_CLEANUP_FUNC instead of VIR_DEFINE_AUTOPTR_FUNC

Since commit 44e7f029
    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: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 1e2ae2e3
...@@ -236,4 +236,4 @@ int virDomainCapsDeviceDefValidate(virDomainCapsPtr const caps, ...@@ -236,4 +236,4 @@ int virDomainCapsDeviceDefValidate(virDomainCapsPtr const caps,
void void
virSEVCapabilitiesFree(virSEVCapability *capabilities); virSEVCapabilitiesFree(virSEVCapability *capabilities);
VIR_DEFINE_AUTOPTR_FUNC(virSEVCapability, virSEVCapabilitiesFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSEVCapability, virSEVCapabilitiesFree);
...@@ -2913,7 +2913,7 @@ bool virDomainDefHasDeviceAddress(virDomainDefPtr def, ...@@ -2913,7 +2913,7 @@ bool virDomainDefHasDeviceAddress(virDomainDefPtr def,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
void virDomainDefFree(virDomainDefPtr vm); void virDomainDefFree(virDomainDefPtr vm);
VIR_DEFINE_AUTOPTR_FUNC(virDomainDef, virDomainDefFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainDef, virDomainDefFree);
virDomainChrSourceDefPtr virDomainChrSourceDefPtr
virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt); virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt);
......
...@@ -35,7 +35,7 @@ struct _virSecretDef { ...@@ -35,7 +35,7 @@ struct _virSecretDef {
}; };
void virSecretDefFree(virSecretDefPtr def); void virSecretDefFree(virSecretDefPtr def);
VIR_DEFINE_AUTOPTR_FUNC(virSecretDef, virSecretDefFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSecretDef, virSecretDefFree);
virSecretDefPtr virSecretDefParseString(const char *xml); virSecretDefPtr virSecretDefParseString(const char *xml);
virSecretDefPtr virSecretDefParseFile(const char *filename); virSecretDefPtr virSecretDefParseFile(const char *filename);
......
...@@ -478,6 +478,6 @@ VIR_ENUM_DECL(virStoragePartedFs); ...@@ -478,6 +478,6 @@ VIR_ENUM_DECL(virStoragePartedFs);
VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART | \ VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART | \
VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE) VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE)
VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolSource, virStoragePoolSourceFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStoragePoolSource, virStoragePoolSourceFree);
VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolDef, virStoragePoolDefFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStoragePoolDef, virStoragePoolDefFree);
VIR_DEFINE_AUTOPTR_FUNC(virStorageVolDef, virStorageVolDefFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageVolDef, virStorageVolDefFree);
...@@ -82,7 +82,7 @@ struct _virNetworkPortDef { ...@@ -82,7 +82,7 @@ struct _virNetworkPortDef {
void void
virNetworkPortDefFree(virNetworkPortDefPtr port); virNetworkPortDefFree(virNetworkPortDefPtr port);
VIR_DEFINE_AUTOPTR_FUNC(virNetworkPortDef, virNetworkPortDefFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkPortDef, virNetworkPortDefFree);
virNetworkPortDefPtr virNetworkPortDefPtr
virNetworkPortDefParseNode(xmlDocPtr xml, virNetworkPortDefParseNode(xmlDocPtr xml,
......
...@@ -87,7 +87,7 @@ qemuBlockNodeNameBackingChainDataFree(qemuBlockNodeNameBackingChainDataPtr data) ...@@ -87,7 +87,7 @@ qemuBlockNodeNameBackingChainDataFree(qemuBlockNodeNameBackingChainDataPtr data)
VIR_FREE(data); VIR_FREE(data);
} }
VIR_DEFINE_AUTOPTR_FUNC(qemuBlockNodeNameBackingChainData, G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockNodeNameBackingChainData,
qemuBlockNodeNameBackingChainDataFree); qemuBlockNodeNameBackingChainDataFree);
......
...@@ -104,7 +104,7 @@ struct qemuBlockStorageSourceAttachData { ...@@ -104,7 +104,7 @@ struct qemuBlockStorageSourceAttachData {
void void
qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data); qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data);
VIR_DEFINE_AUTOPTR_FUNC(qemuBlockStorageSourceAttachData, G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockStorageSourceAttachData,
qemuBlockStorageSourceAttachDataFree); qemuBlockStorageSourceAttachDataFree);
qemuBlockStorageSourceAttachDataPtr qemuBlockStorageSourceAttachDataPtr
...@@ -156,7 +156,7 @@ qemuBlockStorageSourceChainDetach(qemuMonitorPtr mon, ...@@ -156,7 +156,7 @@ qemuBlockStorageSourceChainDetach(qemuMonitorPtr mon,
qemuBlockStorageSourceChainDataPtr data); qemuBlockStorageSourceChainDataPtr data);
VIR_DEFINE_AUTOPTR_FUNC(qemuBlockStorageSourceChainData, G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockStorageSourceChainData,
qemuBlockStorageSourceChainDataFree); qemuBlockStorageSourceChainDataFree);
int int
......
...@@ -39,4 +39,4 @@ int qemuDBusVMStateAdd(virQEMUDriverPtr driver, virDomainObjPtr vm, ...@@ -39,4 +39,4 @@ int qemuDBusVMStateAdd(virQEMUDriverPtr driver, virDomainObjPtr vm,
void qemuDBusVMStateRemove(virQEMUDriverPtr driver, virDomainObjPtr vm, void qemuDBusVMStateRemove(virQEMUDriverPtr driver, virDomainObjPtr vm,
const char *id, bool hot); const char *id, bool hot);
VIR_DEFINE_AUTOPTR_FUNC(qemuDBusVMState, qemuDBusVMStateFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDBusVMState, qemuDBusVMStateFree);
...@@ -186,7 +186,7 @@ qemuFirmwareOSInterfaceFree(qemuFirmwareOSInterface *interfaces) ...@@ -186,7 +186,7 @@ qemuFirmwareOSInterfaceFree(qemuFirmwareOSInterface *interfaces)
} }
VIR_DEFINE_AUTOPTR_FUNC(qemuFirmwareOSInterface, qemuFirmwareOSInterfaceFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmwareOSInterface, qemuFirmwareOSInterfaceFree);
static void static void
...@@ -251,7 +251,7 @@ qemuFirmwareTargetFree(qemuFirmwareTargetPtr target) ...@@ -251,7 +251,7 @@ qemuFirmwareTargetFree(qemuFirmwareTargetPtr target)
} }
VIR_DEFINE_AUTOPTR_FUNC(qemuFirmwareTarget, qemuFirmwareTargetFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmwareTarget, qemuFirmwareTargetFree);
static void static void
...@@ -261,7 +261,7 @@ qemuFirmwareFeatureFree(qemuFirmwareFeature *features) ...@@ -261,7 +261,7 @@ qemuFirmwareFeatureFree(qemuFirmwareFeature *features)
} }
VIR_DEFINE_AUTOPTR_FUNC(qemuFirmwareFeature, qemuFirmwareFeatureFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmwareFeature, qemuFirmwareFeatureFree);
void void
......
...@@ -32,7 +32,7 @@ typedef qemuFirmware *qemuFirmwarePtr; ...@@ -32,7 +32,7 @@ typedef qemuFirmware *qemuFirmwarePtr;
void void
qemuFirmwareFree(qemuFirmwarePtr fw); qemuFirmwareFree(qemuFirmwarePtr fw);
VIR_DEFINE_AUTOPTR_FUNC(qemuFirmware, qemuFirmwareFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmware, qemuFirmwareFree);
qemuFirmwarePtr qemuFirmwarePtr
qemuFirmwareParse(const char *path); qemuFirmwareParse(const char *path);
......
...@@ -93,7 +93,7 @@ qemuMigrationParamsNew(void); ...@@ -93,7 +93,7 @@ qemuMigrationParamsNew(void);
void void
qemuMigrationParamsFree(qemuMigrationParamsPtr migParams); qemuMigrationParamsFree(qemuMigrationParamsPtr migParams);
VIR_DEFINE_AUTOPTR_FUNC(qemuMigrationParams, qemuMigrationParamsFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationParams, qemuMigrationParamsFree);
int int
qemuMigrationParamsApply(virQEMUDriverPtr driver, qemuMigrationParamsApply(virQEMUDriverPtr driver,
......
...@@ -1343,7 +1343,7 @@ int qemuMonitorGetCurrentMachineInfo(qemuMonitorPtr mon, ...@@ -1343,7 +1343,7 @@ int qemuMonitorGetCurrentMachineInfo(qemuMonitorPtr mon,
qemuMonitorCurrentMachineInfoPtr info); qemuMonitorCurrentMachineInfoPtr info);
void qemuMonitorJobInfoFree(qemuMonitorJobInfoPtr job); void qemuMonitorJobInfoFree(qemuMonitorJobInfoPtr job);
VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorJobInfo, qemuMonitorJobInfoFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorJobInfo, qemuMonitorJobInfoFree);
int qemuMonitorGetJobInfo(qemuMonitorPtr mon, int qemuMonitorGetJobInfo(qemuMonitorPtr mon,
qemuMonitorJobInfoPtr **jobs, qemuMonitorJobInfoPtr **jobs,
......
...@@ -77,4 +77,4 @@ void qemuSlirpStop(qemuSlirpPtr slirp, ...@@ -77,4 +77,4 @@ void qemuSlirpStop(qemuSlirpPtr slirp,
int qemuSlirpGetFD(qemuSlirpPtr slirp); int qemuSlirpGetFD(qemuSlirpPtr slirp);
VIR_DEFINE_AUTOPTR_FUNC(qemuSlirp, qemuSlirpFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuSlirp, qemuSlirpFree);
...@@ -116,7 +116,7 @@ qemuVhostUserGPUFeatureFree(qemuVhostUserGPUFeature *features) ...@@ -116,7 +116,7 @@ qemuVhostUserGPUFeatureFree(qemuVhostUserGPUFeature *features)
} }
VIR_DEFINE_AUTOPTR_FUNC(qemuVhostUserGPUFeature, qemuVhostUserGPUFeatureFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuVhostUserGPUFeature, qemuVhostUserGPUFeatureFree);
void void
......
...@@ -31,7 +31,7 @@ typedef qemuVhostUser *qemuVhostUserPtr; ...@@ -31,7 +31,7 @@ typedef qemuVhostUser *qemuVhostUserPtr;
void void
qemuVhostUserFree(qemuVhostUserPtr fw); qemuVhostUserFree(qemuVhostUserPtr fw);
VIR_DEFINE_AUTOPTR_FUNC(qemuVhostUser, qemuVhostUserFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuVhostUser, qemuVhostUserFree);
qemuVhostUserPtr qemuVhostUserPtr
qemuVhostUserParse(const char *path); qemuVhostUserParse(const char *path);
......
...@@ -40,4 +40,4 @@ int virAuthConfigLookup(virAuthConfigPtr auth, ...@@ -40,4 +40,4 @@ int virAuthConfigLookup(virAuthConfigPtr auth,
const char *credname, const char *credname,
const char **value); const char **value);
VIR_DEFINE_AUTOPTR_FUNC(virAuthConfig, virAuthConfigFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virAuthConfig, virAuthConfigFree);
...@@ -157,4 +157,4 @@ void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b) ...@@ -157,4 +157,4 @@ void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b)
void virBitmapShrink(virBitmapPtr map, size_t b); void virBitmapShrink(virBitmapPtr map, size_t b);
VIR_DEFINE_AUTOPTR_FUNC(virBitmap, virBitmapFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virBitmap, virBitmapFree);
...@@ -219,4 +219,4 @@ int virCommandRunNul(virCommandPtr cmd, ...@@ -219,4 +219,4 @@ int virCommandRunNul(virCommandPtr cmd,
virCommandRunNulFunc func, virCommandRunNulFunc func,
void *data); void *data);
VIR_DEFINE_AUTOPTR_FUNC(virCommand, virCommandFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCommand, virCommandFree);
...@@ -81,7 +81,7 @@ virConfPtr virConfReadFile(const char *filename, unsigned int flags); ...@@ -81,7 +81,7 @@ virConfPtr virConfReadFile(const char *filename, unsigned int flags);
virConfPtr virConfReadString(const char *memory, virConfPtr virConfReadString(const char *memory,
unsigned int flags); unsigned int flags);
int virConfFree(virConfPtr conf); int virConfFree(virConfPtr conf);
VIR_DEFINE_AUTOPTR_FUNC(virConf, virConfFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virConf, virConfFree);
void virConfFreeValue(virConfValuePtr val); void virConfFreeValue(virConfValuePtr val);
virConfValuePtr virConfGetValue(virConfPtr conf, virConfValuePtr virConfGetValue(virConfPtr conf,
const char *setting); const char *setting);
......
...@@ -209,4 +209,4 @@ void virErrorRestore(virErrorPtr *savederr); ...@@ -209,4 +209,4 @@ void virErrorRestore(virErrorPtr *savederr);
void virLastErrorPrefixMessage(const char *fmt, ...) void virLastErrorPrefixMessage(const char *fmt, ...)
G_GNUC_PRINTF(1, 2); G_GNUC_PRINTF(1, 2);
VIR_DEFINE_AUTOPTR_FUNC(virError, virFreeError); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virError, virFreeError);
...@@ -378,7 +378,7 @@ int virFileInData(int fd, ...@@ -378,7 +378,7 @@ int virFileInData(int fd,
int *inData, int *inData,
long long *length); long long *length);
VIR_DEFINE_AUTOPTR_FUNC(virFileWrapperFd, virFileWrapperFdFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFileWrapperFd, virFileWrapperFdFree);
int virFileGetXAttr(const char *path, int virFileGetXAttr(const char *path,
const char *name, const char *name,
......
...@@ -114,4 +114,4 @@ int virFirewallApply(virFirewallPtr firewall); ...@@ -114,4 +114,4 @@ int virFirewallApply(virFirewallPtr firewall);
void virFirewallSetLockOverride(bool avoid); void virFirewallSetLockOverride(bool avoid);
VIR_DEFINE_AUTOPTR_FUNC(virFirewall, virFirewallFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFirewall, virFirewallFree);
...@@ -34,7 +34,7 @@ struct _virFirmware { ...@@ -34,7 +34,7 @@ struct _virFirmware {
void void
virFirmwareFree(virFirmwarePtr firmware); virFirmwareFree(virFirmwarePtr firmware);
VIR_DEFINE_AUTOPTR_FUNC(virFirmware, virFirmwareFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFirmware, virFirmwareFree);
void void
virFirmwareFreeList(virFirmwarePtr *firmwares, size_t nfirmwares); virFirmwareFreeList(virFirmwarePtr *firmwares, size_t nfirmwares);
......
...@@ -195,4 +195,4 @@ void *virHashSearch(const virHashTable *table, virHashSearcher iter, ...@@ -195,4 +195,4 @@ void *virHashSearch(const virHashTable *table, virHashSearcher iter,
/* Convenience for when VIR_FREE(value) is sufficient as a data freer. */ /* Convenience for when VIR_FREE(value) is sufficient as a data freer. */
void virHashValueFree(void *value, const void *name); void virHashValueFree(void *value, const void *name);
VIR_DEFINE_AUTOPTR_FUNC(virHashTable, virHashFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virHashTable, virHashFree);
...@@ -163,4 +163,4 @@ char *virJSONStringReformat(const char *jsonstr, bool pretty); ...@@ -163,4 +163,4 @@ char *virJSONStringReformat(const char *jsonstr, bool pretty);
virJSONValuePtr virJSONValueObjectDeflatten(virJSONValuePtr json); virJSONValuePtr virJSONValueObjectDeflatten(virJSONValuePtr json);
VIR_DEFINE_AUTOPTR_FUNC(virJSONValue, virJSONValueFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virJSONValue, virJSONValueFree);
...@@ -63,4 +63,4 @@ bool virMacAddrIsMulticast(const virMacAddr *addr); ...@@ -63,4 +63,4 @@ bool virMacAddrIsMulticast(const virMacAddr *addr);
bool virMacAddrIsBroadcastRaw(const unsigned char s[VIR_MAC_BUFLEN]); bool virMacAddrIsBroadcastRaw(const unsigned char s[VIR_MAC_BUFLEN]);
void virMacAddrFree(virMacAddrPtr addr); void virMacAddrFree(virMacAddrPtr addr);
VIR_DEFINE_AUTOPTR_FUNC(virMacAddr, virMacAddrFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virMacAddr, virMacAddrFree);
...@@ -140,5 +140,5 @@ int ...@@ -140,5 +140,5 @@ int
virMediatedDeviceTypeReadAttrs(const char *sysfspath, virMediatedDeviceTypeReadAttrs(const char *sysfspath,
virMediatedDeviceTypePtr *type); virMediatedDeviceTypePtr *type);
VIR_DEFINE_AUTOPTR_FUNC(virMediatedDevice, virMediatedDeviceFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virMediatedDevice, virMediatedDeviceFree);
VIR_DEFINE_AUTOPTR_FUNC(virMediatedDeviceType, virMediatedDeviceTypeFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virMediatedDeviceType, virMediatedDeviceTypeFree);
...@@ -122,7 +122,7 @@ virNetDevMcastEntryFree(virNetDevMcastEntryPtr entry) ...@@ -122,7 +122,7 @@ virNetDevMcastEntryFree(virNetDevMcastEntryPtr entry)
VIR_FREE(entry); VIR_FREE(entry);
} }
VIR_DEFINE_AUTOPTR_FUNC(virNetDevMcastEntry, virNetDevMcastEntryFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevMcastEntry, virNetDevMcastEntryFree);
typedef struct _virNetDevMcastList virNetDevMcastList; typedef struct _virNetDevMcastList virNetDevMcastList;
typedef virNetDevMcastList *virNetDevMcastListPtr; typedef virNetDevMcastList *virNetDevMcastListPtr;
......
...@@ -311,4 +311,4 @@ int virNetDevSysfsFile(char **pf_sysfs_device_link, ...@@ -311,4 +311,4 @@ int virNetDevSysfsFile(char **pf_sysfs_device_link,
int virNetDevRunEthernetScript(const char *ifname, const char *script) int virNetDevRunEthernetScript(const char *ifname, const char *script)
G_GNUC_NO_INLINE; G_GNUC_NO_INLINE;
VIR_DEFINE_AUTOPTR_FUNC(virNetDevRxFilter, virNetDevRxFilterFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevRxFilter, virNetDevRxFilterFree);
...@@ -94,5 +94,5 @@ void virNetDevIPInfoClear(virNetDevIPInfoPtr ip); ...@@ -94,5 +94,5 @@ void virNetDevIPInfoClear(virNetDevIPInfoPtr ip);
int virNetDevIPInfoAddToDev(const char *ifname, int virNetDevIPInfoAddToDev(const char *ifname,
virNetDevIPInfo const *ipInfo); virNetDevIPInfo const *ipInfo);
VIR_DEFINE_AUTOPTR_FUNC(virNetDevIPAddr, virNetDevIPAddrFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevIPAddr, virNetDevIPAddrFree);
VIR_DEFINE_AUTOPTR_FUNC(virNetDevIPRoute, virNetDevIPRouteFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevIPRoute, virNetDevIPRouteFree);
...@@ -48,4 +48,4 @@ void virNetDevVlanFree(virNetDevVlanPtr vlan); ...@@ -48,4 +48,4 @@ void virNetDevVlanFree(virNetDevVlanPtr vlan);
int virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b); int virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b);
int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src); int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src);
VIR_DEFINE_AUTOPTR_FUNC(virNetDevVlan, virNetDevVlanFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevVlan, virNetDevVlanFree);
...@@ -64,7 +64,7 @@ typedef struct nl_handle virNetlinkHandle; ...@@ -64,7 +64,7 @@ typedef struct nl_handle virNetlinkHandle;
typedef struct nl_sock virNetlinkHandle; typedef struct nl_sock virNetlinkHandle;
# endif # endif
VIR_DEFINE_AUTOPTR_FUNC(virNetlinkHandle, virNetlinkFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetlinkHandle, virNetlinkFree);
typedef struct _virNetlinkEventSrvPrivate virNetlinkEventSrvPrivate; typedef struct _virNetlinkEventSrvPrivate virNetlinkEventSrvPrivate;
typedef virNetlinkEventSrvPrivate *virNetlinkEventSrvPrivatePtr; typedef virNetlinkEventSrvPrivate *virNetlinkEventSrvPrivatePtr;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
# endif # endif
typedef struct nl_msg virNetlinkMsg; typedef struct nl_msg virNetlinkMsg;
VIR_DEFINE_AUTOPTR_FUNC(virNetlinkMsg, nlmsg_free); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetlinkMsg, nlmsg_free);
#else #else
......
...@@ -274,6 +274,6 @@ ssize_t virPCIGetMdevTypes(const char *sysfspath, ...@@ -274,6 +274,6 @@ ssize_t virPCIGetMdevTypes(const char *sysfspath,
void virPCIDeviceAddressFree(virPCIDeviceAddressPtr address); void virPCIDeviceAddressFree(virPCIDeviceAddressPtr address);
VIR_DEFINE_AUTOPTR_FUNC(virPCIDevice, virPCIDeviceFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIDevice, virPCIDeviceFree);
VIR_DEFINE_AUTOPTR_FUNC(virPCIDeviceAddress, virPCIDeviceAddressFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIDeviceAddress, virPCIDeviceAddressFree);
VIR_DEFINE_AUTOPTR_FUNC(virPCIEDeviceInfo, virPCIEDeviceInfoFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIEDeviceInfo, virPCIEDeviceInfoFree);
...@@ -82,4 +82,4 @@ int virPerfReadEvent(virPerfPtr perf, ...@@ -82,4 +82,4 @@ int virPerfReadEvent(virPerfPtr perf,
virPerfEventType type, virPerfEventType type,
uint64_t *value); uint64_t *value);
VIR_DEFINE_AUTOPTR_FUNC(virPerf, virPerfFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPerf, virPerfFree);
...@@ -249,7 +249,7 @@ virSCSIDeviceUsedByInfoFree(virUsedByInfoPtr used_by) ...@@ -249,7 +249,7 @@ virSCSIDeviceUsedByInfoFree(virUsedByInfoPtr used_by)
VIR_FREE(used_by->domname); VIR_FREE(used_by->domname);
VIR_FREE(used_by); VIR_FREE(used_by);
} }
VIR_DEFINE_AUTOPTR_FUNC(virUsedByInfo, virSCSIDeviceUsedByInfoFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virUsedByInfo, virSCSIDeviceUsedByInfoFree);
void void
virSCSIDeviceFree(virSCSIDevicePtr dev) virSCSIDeviceFree(virSCSIDevicePtr dev)
......
...@@ -95,4 +95,4 @@ void virSCSIDeviceListDel(virSCSIDeviceListPtr list, ...@@ -95,4 +95,4 @@ void virSCSIDeviceListDel(virSCSIDeviceListPtr list,
virSCSIDevicePtr virSCSIDeviceListFind(virSCSIDeviceListPtr list, virSCSIDevicePtr virSCSIDeviceListFind(virSCSIDeviceListPtr list,
virSCSIDevicePtr dev); virSCSIDevicePtr dev);
VIR_DEFINE_AUTOPTR_FUNC(virSCSIDevice, virSCSIDeviceFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSCSIDevice, virSCSIDeviceFree);
...@@ -63,4 +63,4 @@ void virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevicePtr dev, ...@@ -63,4 +63,4 @@ void virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevicePtr dev,
void virSCSIVHostDeviceFree(virSCSIVHostDevicePtr dev); void virSCSIVHostDeviceFree(virSCSIVHostDevicePtr dev);
int virSCSIVHostOpenVhostSCSI(int *vhostfd) G_GNUC_NO_INLINE; int virSCSIVHostOpenVhostSCSI(int *vhostfd) G_GNUC_NO_INLINE;
VIR_DEFINE_AUTOPTR_FUNC(virSCSIVHostDevice, virSCSIVHostDeviceFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSCSIVHostDevice, virSCSIVHostDeviceFree);
...@@ -163,4 +163,4 @@ int virSocketAddrPTRDomain(const virSocketAddr *addr, ...@@ -163,4 +163,4 @@ int virSocketAddrPTRDomain(const virSocketAddr *addr,
void virSocketAddrFree(virSocketAddrPtr addr); void virSocketAddrFree(virSocketAddrPtr addr);
VIR_DEFINE_AUTOPTR_FUNC(virSocketAddr, virSocketAddrFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSocketAddr, virSocketAddrFree);
...@@ -552,4 +552,4 @@ void virStorageFileReportBrokenChain(int errcode, ...@@ -552,4 +552,4 @@ void virStorageFileReportBrokenChain(int errcode,
virStorageSourcePtr src, virStorageSourcePtr src,
virStorageSourcePtr parent); virStorageSourcePtr parent);
VIR_DEFINE_AUTOPTR_FUNC(virStorageAuthDef, virStorageAuthDefFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageAuthDef, virStorageAuthDefFree);
...@@ -84,4 +84,4 @@ void virSystemdActivationClaimFDs(virSystemdActivationPtr act, ...@@ -84,4 +84,4 @@ void virSystemdActivationClaimFDs(virSystemdActivationPtr act,
void virSystemdActivationFree(virSystemdActivationPtr act); void virSystemdActivationFree(virSystemdActivationPtr act);
VIR_DEFINE_AUTOPTR_FUNC(virSystemdActivation, virSystemdActivationFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSystemdActivation, virSystemdActivationFree);
...@@ -140,7 +140,7 @@ struct _virTypedParamList { ...@@ -140,7 +140,7 @@ struct _virTypedParamList {
}; };
void virTypedParamListFree(virTypedParamListPtr list); void virTypedParamListFree(virTypedParamListPtr list);
VIR_DEFINE_AUTOPTR_FUNC(virTypedParamList, virTypedParamListFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virTypedParamList, virTypedParamListFree);
size_t virTypedParamListStealParams(virTypedParamListPtr list, size_t virTypedParamListStealParams(virTypedParamListPtr list,
virTypedParameterPtr *params); virTypedParameterPtr *params);
......
...@@ -60,7 +60,7 @@ char *virURIFormat(virURIPtr uri) ...@@ -60,7 +60,7 @@ char *virURIFormat(virURIPtr uri)
char *virURIFormatParams(virURIPtr uri); char *virURIFormatParams(virURIPtr uri);
void virURIFree(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); int virURIResolveAlias(virConfPtr conf, const char *alias, char **uri);
#define VIR_URI_SERVER(uri) ((uri) && (uri)->server ? (uri)->server : "localhost") #define VIR_URI_SERVER(uri) ((uri) && (uri)->server ? (uri)->server : "localhost")
...@@ -98,4 +98,4 @@ void virUSBDeviceListDel(virUSBDeviceListPtr list, ...@@ -98,4 +98,4 @@ void virUSBDeviceListDel(virUSBDeviceListPtr list,
virUSBDevicePtr virUSBDeviceListFind(virUSBDeviceListPtr list, virUSBDevicePtr virUSBDeviceListFind(virUSBDeviceListPtr list,
virUSBDevicePtr dev); virUSBDevicePtr dev);
VIR_DEFINE_AUTOPTR_FUNC(virUSBDevice, virUSBDeviceFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virUSBDevice, virUSBDeviceFree);
...@@ -247,8 +247,8 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virXPathContextNodeSave, virXPathContextNodeRes ...@@ -247,8 +247,8 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virXPathContextNodeSave, virXPathContextNodeRes
.node = _ctxt->node}; \ .node = _ctxt->node}; \
ignore_value(&_ctxt ## CtxtSave) ignore_value(&_ctxt ## CtxtSave)
VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc); G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlDoc, xmlFreeDoc);
VIR_DEFINE_AUTOPTR_FUNC(xmlXPathContext, xmlXPathFreeContext); G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlXPathContext, xmlXPathFreeContext);
typedef int (*virXMLNamespaceParse)(xmlXPathContextPtr ctxt, void **nsdata); typedef int (*virXMLNamespaceParse)(xmlXPathContextPtr ctxt, void **nsdata);
typedef void (*virXMLNamespaceFree)(void *nsdata); typedef void (*virXMLNamespaceFree)(void *nsdata);
......
...@@ -101,4 +101,4 @@ qemuMonitorPtr qemuMonitorTestGetMonitor(qemuMonitorTestPtr test); ...@@ -101,4 +101,4 @@ qemuMonitorPtr qemuMonitorTestGetMonitor(qemuMonitorTestPtr test);
qemuAgentPtr qemuMonitorTestGetAgent(qemuMonitorTestPtr test); qemuAgentPtr qemuMonitorTestGetAgent(qemuMonitorTestPtr test);
virDomainObjPtr qemuMonitorTestGetDomainObj(qemuMonitorTestPtr test); virDomainObjPtr qemuMonitorTestGetDomainObj(qemuMonitorTestPtr test);
VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorTest, qemuMonitorTestFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorTest, qemuMonitorTestFree);
...@@ -43,7 +43,7 @@ typedef virDomain virshDomain; ...@@ -43,7 +43,7 @@ typedef virDomain virshDomain;
void void
virshDomainFree(virDomainPtr dom); virshDomainFree(virDomainPtr dom);
VIR_DEFINE_AUTOPTR_FUNC(virshDomain, virshDomainFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virshDomain, virshDomainFree);
void void
virshDomainCheckpointFree(virDomainCheckpointPtr chk); virshDomainCheckpointFree(virDomainCheckpointPtr chk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册