Tests will need to parse such a definition so it also needs to be freed.
Provide a function for it.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/snapshot_conf.c | 11 +++++++++++
src/conf/snapshot_conf.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 247d3f71b0..f3385d930b 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -95,6 +95,17 @@ virDomainSnapshotDiskDefClear(virDomainSnapshotDiskDefPtr disk)
disk->src = NULL;
}
+void
+virDomainSnapshotDiskDefFree(virDomainSnapshotDiskDefPtr disk)
+{
+ if (!disk)
+ return;
+
+ virDomainSnapshotDiskDefClear(disk);
+ VIR_FREE(disk);
+}
+
+
/* Allocate a new virDomainSnapshotDef; free with virObjectUnref() */
virDomainSnapshotDefPtr
virDomainSnapshotDefNew(void)
diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h
index f4be434afc..445899dd07 100644
--- a/src/conf/snapshot_conf.h
+++ b/src/conf/snapshot_conf.h
@@ -114,6 +114,7 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseNode(xmlDocPtr xml,
bool *current,
unsigned int flags);
virDomainSnapshotDefPtr virDomainSnapshotDefNew(void);
+void virDomainSnapshotDiskDefFree(virDomainSnapshotDiskDefPtr disk);
char *virDomainSnapshotDefFormat(const char *uuidstr,
virDomainSnapshotDefPtr def,
virCapsPtr caps,
--
2.21.0