From 5120577ed79f89e172e3deed534fa9b585f4701f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 10 Dec 2019 13:52:52 +0100 Subject: [PATCH] conf: add private data to virDomainFSDef MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an object to hold the private data and call the allocation function if it's present in xmlopt. Signed-off-by: Ján Tomko Reviewed-by: Daniel P. Berrangé --- src/conf/domain_conf.c | 7 ++++++- src/conf/domain_conf.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 731ed067b7..1290241923 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2279,7 +2279,7 @@ virDomainControllerIsPSeriesPHB(const virDomainControllerDef *cont) virDomainFSDefPtr -virDomainFSDefNew(virDomainXMLOptionPtr xmlopt G_GNUC_UNUSED) +virDomainFSDefNew(virDomainXMLOptionPtr xmlopt) { virDomainFSDefPtr ret; @@ -2289,6 +2289,11 @@ virDomainFSDefNew(virDomainXMLOptionPtr xmlopt G_GNUC_UNUSED) if (!(ret->src = virStorageSourceNew())) goto cleanup; + if (xmlopt && + xmlopt->privateData.fsNew && + !(ret->privateData = xmlopt->privateData.fsNew())) + goto cleanup; + return ret; cleanup: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 16653e8aac..c3a6ccdcda 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -817,6 +817,7 @@ struct _virDomainFSDef { unsigned long long space_soft_limit; /* in bytes */ bool symlinksResolved; virDomainVirtioOptionsPtr virtio; + virObjectPtr privateData; }; @@ -2740,6 +2741,7 @@ struct _virDomainXMLPrivateDataCallbacks { virDomainXMLPrivateDataNewFunc graphicsNew; virDomainXMLPrivateDataNewFunc networkNew; virDomainXMLPrivateDataNewFunc videoNew; + virDomainXMLPrivateDataNewFunc fsNew; virDomainXMLPrivateDataFormatFunc format; virDomainXMLPrivateDataParseFunc parse; /* following function shall return a pointer which will be used as the -- GitLab