From: Masayoshi Mizuma <m.mizuma(a)jp.fujitsu.com>
Assign qemu-img command file path to driver->qemuImgBinary
so that the unit tests can use qemu-img command.
Signed-off-by: Masayoshi Mizuma <m.mizuma(a)jp.fujitsu.com>
---
tests/testutilsqemu.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 4dcc308..8517f31 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -104,7 +104,8 @@ char *
virFindFileInPath(const char *file)
{
if (g_str_has_prefix(file, "qemu-system") ||
- g_str_equal(file, "qemu-kvm")) {
+ g_str_equal(file, "qemu-kvm") ||
+ g_str_equal(file, "qemu-img")) {
return g_strdup_printf("/usr/bin/%s", file);
}
@@ -317,6 +318,7 @@ void qemuTestDriverFree(virQEMUDriver *driver)
virObjectUnref(driver->caps);
virObjectUnref(driver->config);
virObjectUnref(driver->securityManager);
+ virObjectUnref(driver->qemuImgBinary);
}
int qemuTestCapsCacheInsert(virFileCachePtr cache,
@@ -447,6 +449,8 @@ int qemuTestDriverInit(virQEMUDriver *driver)
qemuTestSetHostCPU(driver, driver->hostarch, NULL);
+ driver->qemuImgBinary = virFindFileInPath("qemu-img");
+
return 0;
error:
--
2.27.0