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(a)redhat.com>
---
tests/qemucapabilitiestest.c | 2 +-
tests/qemucaps2xmltest.c | 2 +-
tests/testutilsqemu.c | 7 +++----
tests/testutilsqemu.h | 3 +--
4 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c
index 4c9b7c5322..5477740339 100644
--- a/tests/qemucapabilitiestest.c
+++ b/tests/qemucapabilitiestest.c
@@ -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;
/*
diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c
index 7d3c768bfd..59f676ede1 100644
--- a/tests/qemucaps2xmltest.c
+++ b/tests/qemucaps2xmltest.c
@@ -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;
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index ccc05233db..bce847ce5e 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -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;
diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h
index 949e98f591..25dedb5edd 100644
--- a/tests/testutilsqemu.h
+++ b/tests/testutilsqemu.h
@@ -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);
--
2.20.1