[libvirt] [PATCH 4/5] conf: Refactor virDomainDiskDefParseXML to pass vmdef

John Ferlan jferlan at redhat.com
Mon Jun 22 21:05:06 UTC 2015


Rather than passing the def->seclabels and def->nseclabels, refactor
the API to pass the entire domain definition.  This will be used in a
future patch as well.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/conf/domain_conf.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e02cd49..6259d4a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6390,8 +6390,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
                          xmlNodePtr node,
                          xmlXPathContextPtr ctxt,
                          virHashTablePtr bootHash,
-                         virSecurityLabelDefPtr* vmSeclabels,
-                         int nvmSeclabels,
+                         const virDomainDef *vmdef,
                          unsigned int flags)
 {
     virDomainDiskDefPtr def;
@@ -6930,8 +6929,8 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
         ctxt->node = sourceNode;
         if (virSecurityDeviceLabelDefParseXML(&def->src->seclabels,
                                               &def->src->nseclabels,
-                                              vmSeclabels,
-                                              nvmSeclabels,
+                                              vmdef->seclabels,
+                                              vmdef->nseclabels,
                                               ctxt,
                                               flags) < 0)
             goto error;
@@ -12256,9 +12255,7 @@ virDomainDeviceDefParse(const char *xmlStr,
     switch ((virDomainDeviceType) dev->type) {
     case VIR_DOMAIN_DEVICE_DISK:
         if (!(dev->data.disk = virDomainDiskDefParseXML(xmlopt, node, ctxt,
-                                                        NULL, def->seclabels,
-                                                        def->nseclabels,
-                                                        flags)))
+                                                        NULL, def, flags)))
             goto error;
         break;
     case VIR_DOMAIN_DEVICE_LEASE:
@@ -12400,9 +12397,7 @@ virDomainDiskDefSourceParse(const char *xmlStr,
 
     flags |= VIR_DOMAIN_DEF_PARSE_DISK_SOURCE;
     if (!(disk = virDomainDiskDefParseXML(xmlopt, node, ctxt,
-                                          NULL, def->seclabels,
-                                          def->nseclabels,
-                                          flags)))
+                                          NULL, def, flags)))
         goto cleanup;
 
     ret = disk->src;
@@ -15418,8 +15413,7 @@ virDomainDefParseXML(xmlDocPtr xml,
                                                             nodes[i],
                                                             ctxt,
                                                             bootHash,
-                                                            def->seclabels,
-                                                            def->nseclabels,
+                                                            def,
                                                             flags);
         if (!disk)
             goto error;
-- 
2.1.0




More information about the libvir-list mailing list