]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: fix domain parse flags
authorLaine Stump <laine@laine.org>
Mon, 4 Jul 2011 19:06:07 +0000 (15:06 -0400)
committerLaine Stump <laine@laine.org>
Tue, 5 Jul 2011 16:33:21 +0000 (12:33 -0400)
* Change all flags args from int to unsigned int

* Allow passing flags in virDomainObjParseFile (and propogate those
  flags all the way down the call chain). Previously the flags were
  hardcoded (to VIR_DOMAIN_XML_INTERNAL_STATUS) several layers down
  the chain. Pass that value in at the one place that is currently
  calling virDomainObjParseFile.

src/conf/domain_conf.c
src/conf/domain_conf.h

index 109a947a90371258e02e2732c019d5f8b5e54cf0..772422d1a2a79fafd93f0468f7fa7cc4e6832dbe 100644 (file)
@@ -5160,7 +5160,7 @@ error:
 virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
                                               const virDomainDefPtr def,
                                               const char *xmlStr,
-                                              int flags)
+                                              unsigned int flags)
 {
     xmlDocPtr xml;
     xmlNodePtr node;
@@ -6703,7 +6703,8 @@ no_memory:
 
 static virDomainObjPtr virDomainObjParseXML(virCapsPtr caps,
                                             xmlDocPtr xml,
-                                            xmlXPathContextPtr ctxt)
+                                            xmlXPathContextPtr ctxt,
+                                            unsigned int flags)
 {
     char *tmp = NULL;
     long val;
@@ -6726,8 +6727,7 @@ static virDomainObjPtr virDomainObjParseXML(virCapsPtr caps,
 
     oldnode = ctxt->node;
     ctxt->node = config;
-    obj->def = virDomainDefParseXML(caps, xml, config, ctxt,
-                                    VIR_DOMAIN_XML_INTERNAL_STATUS);
+    obj->def = virDomainDefParseXML(caps, xml, config, ctxt, flags);
     ctxt->node = oldnode;
     if (!obj->def)
         goto error;
@@ -6816,14 +6816,14 @@ virDomainDefParse(const char *xmlStr,
 
 virDomainDefPtr virDomainDefParseString(virCapsPtr caps,
                                         const char *xmlStr,
-                                        int flags)
+                                        unsigned int flags)
 {
     return virDomainDefParse(xmlStr, NULL, caps, flags);
 }
 
 virDomainDefPtr virDomainDefParseFile(virCapsPtr caps,
                                       const char *filename,
-                                      int flags)
+                                      unsigned int flags)
 {
     return virDomainDefParse(NULL, filename, caps, flags);
 }
@@ -6832,7 +6832,7 @@ virDomainDefPtr virDomainDefParseFile(virCapsPtr caps,
 virDomainDefPtr virDomainDefParseNode(virCapsPtr caps,
                                       xmlDocPtr xml,
                                       xmlNodePtr root,
-                                      int flags)
+                                      unsigned int flags)
 {
     xmlXPathContextPtr ctxt = NULL;
     virDomainDefPtr def = NULL;
@@ -6861,7 +6861,8 @@ cleanup:
 static virDomainObjPtr
 virDomainObjParseNode(virCapsPtr caps,
                       xmlDocPtr xml,
-                      xmlNodePtr root)
+                      xmlNodePtr root,
+                      unsigned int flags)
 {
     xmlXPathContextPtr ctxt = NULL;
     virDomainObjPtr obj = NULL;
@@ -6879,7 +6880,7 @@ virDomainObjParseNode(virCapsPtr caps,
     }
 
     ctxt->node = root;
-    obj = virDomainObjParseXML(caps, xml, ctxt);
+    obj = virDomainObjParseXML(caps, xml, ctxt, flags);
 
 cleanup:
     xmlXPathFreeContext(ctxt);
@@ -6888,13 +6889,15 @@ cleanup:
 
 
 virDomainObjPtr virDomainObjParseFile(virCapsPtr caps,
-                                      const char *filename)
+                                      const char *filename,
+                                      unsigned int flags)
 {
     xmlDocPtr xml;
     virDomainObjPtr obj = NULL;
 
     if ((xml = virXMLParseFile(filename))) {
-        obj = virDomainObjParseNode(caps, xml, xmlDocGetRootElement(xml));
+        obj = virDomainObjParseNode(caps, xml,
+                                    xmlDocGetRootElement(xml), flags);
         xmlFreeDoc(xml);
     }
 
@@ -9500,7 +9503,7 @@ virDomainHostdevDefFormat(virBufferPtr buf,
 
 
 char *virDomainDefFormat(virDomainDefPtr def,
-                         int flags)
+                         unsigned int flags)
 {
     virBuffer buf = VIR_BUFFER_INITIALIZER;
     unsigned char *uuid;
@@ -10138,7 +10141,8 @@ static virDomainObjPtr virDomainLoadStatus(virCapsPtr caps,
     if ((statusFile = virDomainConfigFile(statusDir, name)) == NULL)
         goto error;
 
-    if (!(obj = virDomainObjParseFile(caps, statusFile)))
+    if (!(obj = virDomainObjParseFile(caps, statusFile,
+                                      VIR_DOMAIN_XML_INTERNAL_STATUS)))
         goto error;
 
     virUUIDFormat(obj->def->uuid, uuidstr);
index 258289a72893365fa89214260da39427be059ff8..9d28f51262e8ebe367a91e3fa27d8d64e74a5935 100644 (file)
@@ -1378,20 +1378,21 @@ void virDomainRemoveInactive(virDomainObjListPtr doms,
 virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
                                               const virDomainDefPtr def,
                                               const char *xmlStr,
-                                              int flags);
+                                              unsigned int flags);
 virDomainDefPtr virDomainDefParseString(virCapsPtr caps,
                                         const char *xmlStr,
-                                        int flags);
+                                        unsigned int flags);
 virDomainDefPtr virDomainDefParseFile(virCapsPtr caps,
                                       const char *filename,
-                                      int flags);
+                                      unsigned int flags);
 virDomainDefPtr virDomainDefParseNode(virCapsPtr caps,
                                       xmlDocPtr doc,
                                       xmlNodePtr root,
-                                      int flags);
+                                      unsigned int flags);
 
 virDomainObjPtr virDomainObjParseFile(virCapsPtr caps,
-                                      const char *filename);
+                                      const char *filename,
+                                      unsigned int flags);
 
 bool virDomainDefCheckABIStability(virDomainDefPtr src,
                                    virDomainDefPtr dst);
@@ -1399,7 +1400,7 @@ bool virDomainDefCheckABIStability(virDomainDefPtr src,
 int virDomainDefAddImplicitControllers(virDomainDefPtr def);
 
 char *virDomainDefFormat(virDomainDefPtr def,
-                         int flags);
+                         unsigned int flags);
 
 int virDomainCpuSetParse(const char **str,
                          char sep,