On Thu, May 24, 2018 at 12:39:09 +0200, Ján Tomko wrote:
A type to represent the new vsock device.
Also implement an allocation function to allow future addition
of private data.
https://bugzilla.redhat.com/show_bug.cgi?id=1291851
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/conf/domain_conf.c | 21 +++++++++++++++++++++
src/conf/domain_conf.h | 8 ++++++++
src/libvirt_private.syms | 1 +
3 files changed, 30 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3689ac0a82..5b4b182fd2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2027,6 +2027,27 @@ virDomainActualNetDefFree(virDomainActualNetDefPtr def)
VIR_FREE(def);
}
+
+virDomainVsockDefPtr
+virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt ATTRIBUTE_UNUSED)
+{
+ virDomainVsockDefPtr ret = NULL;
+ virDomainVsockDefPtr vsock;
+
+ if (VIR_ALLOC(vsock) < 0)
+ return NULL;
+
+ VIR_STEAL_PTR(ret, vsock);
+ return ret;
+}
+
+
+void
+virDomainVsockDefFree(virDomainVsockDefPtr vsock ATTRIBUTE_UNUSED)
+{
You should 'VIR_FREE(vsock)' here, as otherwise this does not do what
the name suggests ...
+}
+
+
void
virDomainNetDefClear(virDomainNetDefPtr def)
ACK with the modification above