[libvirt PATCH 10/17] tests: testutilsqemu: move virFindFileInPath into domaincapsmock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Having the function on mock library reflect more closely what we usually
do in tests.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 tests/domaincapsmock.c | 16 ++++++++++++++++
 tests/testutilsqemu.c  | 15 ---------------
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c
index d81a898dc0..73690f0b9e 100644
--- a/tests/domaincapsmock.c
+++ b/tests/domaincapsmock.c
@@ -16,6 +16,7 @@
 
 #include <config.h>
 
+#include "virfile.h"
 #include "virhostcpu.h"
 #ifdef WITH_LIBXL
 # include "libxl/libxl_capabilities.h"
@@ -40,3 +41,18 @@ virHostCPUGetMicrocodeVersion(virArch hostArch G_GNUC_UNUSED)
 {
     return 0;
 }
+
+char *
+virFindFileInPath(const char *file)
+{
+    if (g_str_has_prefix(file, "qemu-system") ||
+        g_str_equal(file, "qemu-kvm")) {
+        return g_strdup_printf("/usr/bin/%s", file);
+    }
+
+    /* Nothing in tests should be relying on real files
+     * in host OS, so we return NULL to try to force
+     * an error in such a case
+     */
+    return NULL;
+}
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 7451929807..0a2af5036e 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -117,21 +117,6 @@ static const char *qemu_default_ram_id[VIR_ARCH_LAST] = {
     [VIR_ARCH_SPARC] = "sun4m.ram",
 };
 
-char *
-virFindFileInPath(const char *file)
-{
-    if (g_str_has_prefix(file, "qemu-system") ||
-        g_str_equal(file, "qemu-kvm")) {
-        return g_strdup_printf("/usr/bin/%s", file);
-    }
-
-    /* Nothing in tests should be relying on real files
-     * in host OS, so we return NULL to try to force
-     * an error in such a case
-     */
-    return NULL;
-}
-
 
 virCapsHostNUMA *
 virCapabilitiesHostNUMANewHost(void)
-- 
2.30.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux