Add 'conf:' prefix.
On Thu, May 24, 2018 at 12:39:10 +0200, Ján Tomko wrote:
An object for storing driver-specific data in the vsock definition.
https://bugzilla.redhat.com/show_bug.cgi?id=1291851
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/conf/domain_conf.c | 16 ++++++++++++++--
src/conf/domain_conf.h | 2 ++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5b4b182fd2..b2982fc3d4 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2029,7 +2029,7 @@ virDomainActualNetDefFree(virDomainActualNetDefPtr def)
virDomainVsockDefPtr
-virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED)
+virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt)
{
virDomainVsockDefPtr ret = NULL;
virDomainVsockDefPtr vsock;
@@ -2037,14 +2037,26 @@ virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt
ATTRIBUTE_UNUSED)
if (VIR_ALLOC(vsock) < 0)
return NULL;
+ if (xmlopt &&
+ xmlopt->privateData.vsockNew &&
+ !(vsock->privateData = xmlopt->privateData.vsockNew()))
+ goto cleanup;
+
VIR_STEAL_PTR(ret, vsock);
+ cleanup:
+ virDomainVsockDefFree(vsock);
This will leak the struct if you don't do what I've suggested before.
ACK