On a Friday in 2020, Peter Krempa wrote:
We store the config of an iSCSI hostdev in a virStorageSource structure. Parse the private data portion. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/conf/domain_conf.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index bda9375f13..ceaf73772d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8283,7 +8283,9 @@ virDomainHostdevSubsysSCSIHostDefParseXML(xmlNodePtr sourcenode, static int virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr sourcenode, virDomainHostdevSubsysSCSIPtr def, - xmlXPathContextPtr ctxt) + xmlXPathContextPtr ctxt, + unsigned int flags, + virDomainXMLOptionPtr xmlopt) { int auth_secret_usage = -1; xmlNodePtr cur; @@ -8348,13 +8350,27 @@ virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr sourcenode, } cur = cur->next; } + + if ((flags & VIR_DOMAIN_DEF_PARSE_STATUS) &&
Extra parentheses.
+ xmlopt && xmlopt->privateData.storageParse) { + VIR_XPATH_NODE_AUTORESTORE(ctxt); + + ctxt->node = sourcenode; + + if ((ctxt->node = virXPathNode("./privateData", ctxt)) && + xmlopt->privateData.storageParse(ctxt, iscsisrc->src) < 0) + return -1; + } + return 0; }
Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx> Jano
Attachment:
signature.asc
Description: PGP signature