Guests are handled in callers, but if something goes wrong (when it
cannot be added to virCapabilities, for example), there's no way for
them to free it properly.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/conf/capabilities.c | 2 +-
src/conf/capabilities.h | 3 +++
src/libvirt_private.syms | 1 +
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 9ab343bc6550..87e274c06675 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -148,7 +148,7 @@ virCapabilitiesFreeGuestFeature(virCapsGuestFeaturePtr feature)
VIR_FREE(feature);
}
-static void
+void
virCapabilitiesFreeGuest(virCapsGuestPtr guest)
{
size_t i;
diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
index cfdc34a66b88..8634fda14458 100644
--- a/src/conf/capabilities.h
+++ b/src/conf/capabilities.h
@@ -248,6 +248,9 @@ void
virCapabilitiesFreeMachines(virCapsGuestMachinePtr *machines,
int nmachines);
+void
+virCapabilitiesFreeGuest(virCapsGuestPtr guest);
+
virCapsGuestPtr
virCapabilitiesAddGuest(virCapsPtr caps,
int ostype,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 7627be9956eb..b504c524ce83 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -53,6 +53,7 @@ virCapabilitiesAllocMachines;
virCapabilitiesClearHostNUMACellCPUTopology;
virCapabilitiesDomainDataLookup;
virCapabilitiesFormatXML;
+virCapabilitiesFreeGuest;
virCapabilitiesFreeMachines;
virCapabilitiesFreeNUMAInfo;
virCapabilitiesGetCpusForNodemask;
--
2.12.0