]> xenbits.xensource.com Git - libvirt.git/commitdiff
testCompareDomXML2XMLFiles: add parseFlags parameter
authorJán Tomko <jtomko@redhat.com>
Thu, 25 Feb 2016 14:17:14 +0000 (15:17 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 26 Feb 2016 08:47:45 +0000 (09:47 +0100)
Allow testing XML parsing with different flags.

tests/bhyvexml2xmltest.c
tests/genericxml2xmltest.c
tests/lxcxml2xmltest.c
tests/qemuxml2xmltest.c
tests/testutils.c
tests/testutils.h

index 2d34a00fec9aa1f46e4dd0502ab098faa56c6aca..8f556eeee64cf4b5bc2d086efd652cefab38ff52 100644 (file)
@@ -33,7 +33,7 @@ testCompareXMLToXMLHelper(const void *data)
     ret = testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, xml_in,
                                      info->different ? xml_out : xml_in,
                                      false,
-                                     NULL, NULL);
+                                     NULL, NULL, 0);
 
  cleanup:
     VIR_FREE(xml_in);
index aa3a5708544a29c92dec9d0e7179a36080a1ac11..bf9b11d3de58bbcf24ba1cde2f9c73e8bc9fefee 100644 (file)
@@ -40,7 +40,7 @@ testCompareXMLToXMLHelper(const void *data)
     ret = testCompareDomXML2XMLFiles(caps, xmlopt, xml_in,
                                      info->different ? xml_out : xml_in,
                                      !info->inactive_only,
-                                     NULL, NULL);
+                                     NULL, NULL, 0);
  cleanup:
     VIR_FREE(xml_in);
     VIR_FREE(xml_out);
index aafebb4da85e01b836668f37c93609925e4bd633..8174a544d8d720c9e389a6c2ec1d8ce73d71dc46 100644 (file)
@@ -45,7 +45,7 @@ testCompareXMLToXMLHelper(const void *data)
     ret = testCompareDomXML2XMLFiles(caps, xmlopt, xml_in,
                                      info->different ? xml_out : xml_in,
                                      !info->inactive_only,
-                                     NULL, NULL);
+                                     NULL, NULL, 0);
  cleanup:
     VIR_FREE(xml_in);
     VIR_FREE(xml_out);
index ef6e35a9cdc04c1cfb8ec29c45c66a50492e4eac..80c80f663e3033e9dd28e4803959c204edf8cf8b 100644 (file)
@@ -54,7 +54,7 @@ testXML2XMLActive(const void *opaque)
 
     return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt,
                                       info->inName, info->outActiveName, true,
-                                      qemuXML2XMLPreFormatCallback, opaque);
+                                      qemuXML2XMLPreFormatCallback, opaque, 0);
 }
 
 
@@ -65,7 +65,7 @@ testXML2XMLInactive(const void *opaque)
 
     return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->inName,
                                       info->outInactiveName, false,
-                                      qemuXML2XMLPreFormatCallback, opaque);
+                                      qemuXML2XMLPreFormatCallback, opaque, 0);
 }
 
 
index c1ca6568fa944d4bd781954a1b31216940c2e68b..b1bd4e88773523635f259c757c58b6060967851f 100644 (file)
@@ -1054,13 +1054,16 @@ int
 testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
                            const char *infile, const char *outfile, bool live,
                            testCompareDomXML2XMLPreFormatCallback cb,
-                           const void *opaque)
+                           const void *opaque, unsigned int parseFlags)
 {
     char *actual = NULL;
     int ret = -1;
     virDomainDefPtr def = NULL;
     unsigned int parse_flags = live ? 0 : VIR_DOMAIN_DEF_PARSE_INACTIVE;
     unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE;
+
+    parse_flags |= parseFlags;
+
     if (!live)
         format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;
 
index bb58148453664ccbca88c7c84e1cd8d1ff2f0704..752fa52514e89b68c987f01d39e0f0eafa04f4c6 100644 (file)
@@ -142,6 +142,7 @@ int testCompareDomXML2XMLFiles(virCapsPtr caps,
                                const char *outfile,
                                bool live,
                                testCompareDomXML2XMLPreFormatCallback cb,
-                               const void *opaque);
+                               const void *opaque,
+                               unsigned int parseFlags);
 
 #endif /* __VIT_TEST_UTILS_H__ */