From: Peter Krempa Date: Tue, 25 Mar 2025 16:27:19 +0000 (+0100) Subject: virStorageNetHostDefClear: Move into virStorageNetHostDefFree X-Git-Tag: v11.3.0-rc1~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5da6b62419110abe136b3fd98400366a85d4c0a4;p=thirdparty%2Flibvirt.git virStorageNetHostDefClear: Move into virStorageNetHostDefFree There are no other callers. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index db12dfd961..9f28580406 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -142,18 +142,6 @@ virStorageSourceHasBacking(const virStorageSource *src) } -void -virStorageNetHostDefClear(virStorageNetHostDef *def) -{ - if (!def) - return; - - VIR_FREE(def->name); - VIR_FREE(def->socket); - VIR_FREE(def->fdgroup); -} - - void virStorageNetHostDefFree(size_t nhosts, virStorageNetHostDef *hosts) @@ -163,8 +151,11 @@ virStorageNetHostDefFree(size_t nhosts, if (!hosts) return; - for (i = 0; i < nhosts; i++) - virStorageNetHostDefClear(&hosts[i]); + for (i = 0; i < nhosts; i++) { + g_free(hosts[i].name); + g_free(hosts[i].socket); + g_free(hosts[i].fdgroup); + } g_free(hosts); } diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index 52ed303657..de7895e637 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -505,9 +505,6 @@ virSecurityDeviceLabelDef * virStorageSourceGetSecurityLabelDef(virStorageSource *src, const char *model); -void -virStorageNetHostDefClear(virStorageNetHostDef *def); - void virStorageNetHostDefFree(size_t nhosts, virStorageNetHostDef *hosts); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 812fa4e435..a8ebf9efd8 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1153,7 +1153,6 @@ virStorageFileFeatureTypeFromString; virStorageFileFeatureTypeToString; virStorageFileFormatTypeFromString; virStorageFileFormatTypeToString; -virStorageNetHostDefClear; virStorageNetHostDefCopy; virStorageNetHostDefFree; virStorageNetHostTransportTypeFromString;