提交 45dff4bb 编写于 作者: A Andrea Bolognani

tests: Drop dirname argument from testQemuCapsIterate()

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: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NCole Robinson <crobinso@redhat.com>
上级 3fe020a0
......@@ -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;
/*
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册