conf: storage: Introduce virStoragePoolSourceListFree

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-06-16 10:04:30 +02:00
parent ff8557b433
commit 3776b6a93d
3 changed files with 22 additions and 0 deletions

View File

@ -1803,3 +1803,19 @@ virStoragePoolSourceListFormat(virStoragePoolSourceList *def)
return virBufferContentAndReset(&buf);
}
void
virStoragePoolSourceListFree(virStoragePoolSourceList *list)
{
size_t i;
if (!list)
return;
for (i = 0; i < list->nsources; i++)
virStoragePoolSourceClear(&list->sources[i]);
g_free(list->sources);
g_free(list);
}

View File

@ -266,6 +266,11 @@ struct _virStoragePoolSourceList {
virStoragePoolSource *sources;
};
void
virStoragePoolSourceListFree(virStoragePoolSourceList *list);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStoragePoolSourceList, virStoragePoolSourceListFree);
virStoragePoolDef *
virStoragePoolDefParseXML(xmlXPathContextPtr ctxt);

View File

@ -1048,6 +1048,7 @@ virStoragePoolSourceClear;
virStoragePoolSourceDeviceClear;
virStoragePoolSourceFree;
virStoragePoolSourceListFormat;
virStoragePoolSourceListFree;
virStoragePoolSourceListNewSource;
virStoragePoolTypeFromString;
virStoragePoolTypeToString;