]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Drop dirname argument from testQemuCapsIterate()
authorAndrea Bolognani <abologna@redhat.com>
Tue, 16 Apr 2019 10:33:14 +0000 (12:33 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 17 Apr 2019 06:30:57 +0000 (08:30 +0200)
As evidenced by all existing callers, the only directory it makes
sense to use is TEST_QEMU_CAPS_PATH, so let's just bake that into
the function.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
tests/qemucapabilitiestest.c
tests/qemucaps2xmltest.c
tests/testutilsqemu.c
tests/testutilsqemu.h

index 4c9b7c5322ffb02620683dc6e33a504c1cbf9cb2..5477740339d60ef949b2285db1a43ce4f852e0ed 100644 (file)
@@ -221,7 +221,7 @@ mymain(void)
     if (testQemuDataInit(&data) < 0)
         return EXIT_FAILURE;
 
-    if (testQemuCapsIterate(data.dataDir, ".replies", doCapsTest, &data) < 0)
+    if (testQemuCapsIterate(".replies", doCapsTest, &data) < 0)
         return EXIT_FAILURE;
 
     /*
index 7d3c768bfd8404551e3256da8570cdae01f705e3..59f676ede14464bfd7c2bdfc86f8725de601fe89 100644 (file)
@@ -212,7 +212,7 @@ mymain(void)
     if (testQemuDataInit(&data) < 0)
         return EXIT_FAILURE;
 
-    if (testQemuCapsIterate(data.inputDir, ".xml", doCapsTest, &data) < 0)
+    if (testQemuCapsIterate(".xml", doCapsTest, &data) < 0)
         return EXIT_FAILURE;
 
     return (data.ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
index ccc05233dbf8732558e6e080e69aaaeff3025f71..bce847ce5e1cb71c3a007d6fcd616d4298a430df 100644 (file)
@@ -903,8 +903,7 @@ testQemuGetLatestCaps(void)
 
 
 int
-testQemuCapsIterate(const char *dirname,
-                    const char *suffix,
+testQemuCapsIterate(const char *suffix,
                     testQemuCapsIterateCallback callback,
                     void *opaque)
 {
@@ -916,10 +915,10 @@ testQemuCapsIterate(const char *dirname,
     if (!callback)
         return 0;
 
-    if (virDirOpen(&dir, dirname) < 0)
+    if (virDirOpen(&dir, TEST_QEMU_CAPS_PATH) < 0)
         goto cleanup;
 
-    while ((rc = virDirRead(dir, &ent, dirname) > 0)) {
+    while ((rc = virDirRead(dir, &ent, TEST_QEMU_CAPS_PATH) > 0)) {
         char *tmp = ent->d_name;
         char *base = NULL;
         char *archName = NULL;
index 949e98f59129ae1af94a577c22f302b6d68c3893..25dedb5edd272f07401d636df4d719335a2f7ed3 100644 (file)
@@ -99,8 +99,7 @@ virHashTablePtr testQemuGetLatestCaps(void);
 typedef int (*testQemuCapsIterateCallback)(const char *base,
                                            const char *archName,
                                            void *opaque);
-int testQemuCapsIterate(const char *dirname,
-                        const char *suffix,
+int testQemuCapsIterate(const char *suffix,
                         testQemuCapsIterateCallback callback,
                         void *opaque);