diff mbox series

[02/12] tests: qemuxml2xml: Add info->{in, out}file

Message ID 31040eaf236a6e468dc9e88cebaff6bada2a9b58.1554137098.git.crobinso@redhat.com
State Accepted
Commit ebf6df814e341b53afd1ab0ff85e2138d0198125
Headers show
Series tests: qemuxml2xml: add DO_TEST_CAPS* | expand

Commit Message

Cole Robinson April 1, 2019, 4:47 p.m. UTC
Just renamed from existing inName and outActiveName

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
 tests/qemuxml2xmltest.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Andrea Bolognani April 10, 2019, 3:40 p.m. UTC | #1
On Mon, 2019-04-01 at 12:47 -0400, Cole Robinson wrote:
> Just renamed from existing inName and outActiveName

> 

> Signed-off-by: Cole Robinson <crobinso@redhat.com>

> ---

>  tests/qemuxml2xmltest.c | 36 ++++++++++++++++++------------------

>  1 file changed, 18 insertions(+), 18 deletions(-)


Reviewed-by: Andrea Bolognani <abologna@redhat.com>


-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox series

Patch

diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 2dfa9e628b..0ced565fbc 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -26,8 +26,8 @@  enum {
 };
 
 struct testInfo {
-    char *inName;
-    char *outActiveName;
+    char *infile;
+    char *outfile;
     char *outInactiveName;
 
     virQEMUCapsPtr qemuCaps;
@@ -40,7 +40,7 @@  testXML2XMLActive(const void *opaque)
     const struct testInfo *info = opaque;
 
     return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt,
-                                      info->inName, info->outActiveName, true,
+                                      info->infile, info->outfile, true,
                                       0,
                                       TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS);
 }
@@ -51,7 +51,7 @@  testXML2XMLInactive(const void *opaque)
 {
     const struct testInfo *info = opaque;
 
-    return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->inName,
+    return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->infile,
                                       info->outInactiveName, false,
                                       0,
                                       TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS);
@@ -66,13 +66,13 @@  testCompareStatusXMLToXMLFiles(const void *opaque)
     char *actual = NULL;
     int ret = -1;
 
-    if (!(obj = virDomainObjParseFile(data->inName, driver.caps, driver.xmlopt,
+    if (!(obj = virDomainObjParseFile(data->infile, driver.caps, driver.xmlopt,
                                       VIR_DOMAIN_DEF_PARSE_STATUS |
                                       VIR_DOMAIN_DEF_PARSE_ACTUAL_NET |
                                       VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES |
                                       VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE |
                                       VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) {
-        VIR_TEST_DEBUG("\nfailed to parse '%s'\n", data->inName);
+        VIR_TEST_DEBUG("\nfailed to parse '%s'\n", data->infile);
         goto cleanup;
     }
 
@@ -82,11 +82,11 @@  testCompareStatusXMLToXMLFiles(const void *opaque)
                                       VIR_DOMAIN_DEF_FORMAT_ACTUAL_NET |
                                       VIR_DOMAIN_DEF_FORMAT_PCI_ORIG_STATES |
                                       VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST))) {
-        VIR_TEST_DEBUG("\nfailed to format back '%s'\n", data->inName);
+        VIR_TEST_DEBUG("\nfailed to format back '%s'\n", data->infile);
         goto cleanup;
     }
 
-    if (virTestCompareToFile(actual, data->outActiveName) < 0)
+    if (virTestCompareToFile(actual, data->outfile) < 0)
         goto cleanup;
 
     ret = 0;
@@ -101,8 +101,8 @@  testCompareStatusXMLToXMLFiles(const void *opaque)
 static void
 testInfoClear(struct testInfo *info)
 {
-    VIR_FREE(info->inName);
-    VIR_FREE(info->outActiveName);
+    VIR_FREE(info->infile);
+    VIR_FREE(info->outfile);
     VIR_FREE(info->outInactiveName);
 
     virObjectUnref(info->qemuCaps);
@@ -134,7 +134,7 @@  testInfoSetPaths(struct testInfo *info,
                  const char *name,
                  int when)
 {
-    if (virAsprintf(&info->inName, "%s/qemuxml2argvdata/%s.xml",
+    if (virAsprintf(&info->infile, "%s/qemuxml2argvdata/%s.xml",
                     abs_srcdir, name) < 0)
         goto error;
 
@@ -155,15 +155,15 @@  testInfoSetPaths(struct testInfo *info,
     }
 
     if (when & WHEN_ACTIVE) {
-        if (virAsprintf(&info->outActiveName,
+        if (virAsprintf(&info->outfile,
                         "%s/qemuxml2xmloutdata/%s-active.xml",
                         abs_srcdir, name) < 0)
             goto error;
 
-        if (!virFileExists(info->outActiveName)) {
-            VIR_FREE(info->outActiveName);
+        if (!virFileExists(info->outfile)) {
+            VIR_FREE(info->outfile);
 
-            if (virAsprintf(&info->outActiveName,
+            if (virAsprintf(&info->outfile,
                             "%s/qemuxml2xmloutdata/%s.xml",
                             abs_srcdir, name) < 0)
                 goto error;
@@ -184,8 +184,8 @@  static int
 testInfoSetStatusPaths(struct testInfo *info,
                        const char *name)
 {
-    if (virAsprintf(&info->inName, "%s%s-in.xml", statusPath, name) < 0 ||
-        virAsprintf(&info->outActiveName, "%s%s-out.xml", statusPath, name) < 0)
+    if (virAsprintf(&info->infile, "%s%s-in.xml", statusPath, name) < 0 ||
+        virAsprintf(&info->outfile, "%s%s-out.xml", statusPath, name) < 0)
         goto error;
 
     return 0;
@@ -240,7 +240,7 @@  mymain(void)
                 ret = -1; \
         } \
  \
-        if (info.outActiveName) { \
+        if (info.outfile) { \
             if (virTestRun("QEMU XML-2-XML-active " name, \
                             testXML2XMLActive, &info) < 0) \
                 ret = -1; \