From e6a55927878ab560b80926e91584b02cb07fbe69 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 18 Apr 2024 09:19:52 +0200 Subject: [PATCH] datatypes: Declare g_autoptr cleanup functions for more public objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some public objects (like virDomain, virInterface, and so on) are missing g_autoptr() cleanup functions. Provide missing declarations. Note, this is only for our internal use - hence datatypes.h. Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrangé --- src/datatypes.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/datatypes.h b/src/datatypes.h index f8b1a83407..c5a7ece786 100644 --- a/src/datatypes.h +++ b/src/datatypes.h @@ -604,6 +604,9 @@ struct _virDomain { unsigned char uuid[VIR_UUID_BUFLEN]; /* the domain unique identifier */ }; +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomain, virObjectUnref); + + /** * _virNetwork: * @@ -647,6 +650,9 @@ struct _virInterface { char *mac; /* the interface MAC address */ }; +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virInterface, virObjectUnref); + + /** * _virStoragePool: * @@ -706,6 +712,7 @@ struct _virNodeDevice { G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNodeDevice, virObjectUnref); + /** * _virSecret: * @@ -751,6 +758,8 @@ struct _virDomainCheckpoint { virDomainPtr domain; }; +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainCheckpoint, virObjectUnref); + /** * _virDomainSnapshot @@ -763,6 +772,9 @@ struct _virDomainSnapshot { virDomainPtr domain; }; +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainSnapshot, virObjectUnref); + + /** * _virNWFilter: * @@ -775,6 +787,8 @@ struct _virNWFilter { unsigned char uuid[VIR_UUID_BUFLEN]; /* the network filter unique identifier */ }; +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNWFilter, virObjectUnref); + /** * _virNWFilterBinding: @@ -788,6 +802,8 @@ struct _virNWFilterBinding { char *filtername; /* the network filter name */ }; +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNWFilterBinding, virObjectUnref); + /* * Helper APIs for allocating new object instances