[libvirt PATCH] tests: Undo recent breakages

Andrea Bolognani abologna at redhat.com
Mon Mar 6 14:38:41 UTC 2023


Turns out that those overrides that I recently removed where
actually there for a reason :)

Until a solution that can both ensure predictable output and
avoid code duplication is developed, return to the (slightly
improved) status quo.

Fixes: 0f49b6cc6b81 ("tests: Drop no longer necessary overrides")
Fixes: 0b464cd84ff3 ("tests: Drop more QEMU driver config overrides")
Signed-off-by: Andrea Bolognani <abologna at redhat.com>
---
I will push this under the build breaker rule as soon as the
corresponding pipeline[1] has successfully completed.

[1] https://gitlab.com/abologna/libvirt/-/pipelines/797404546

 tests/testutilsqemu.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index d3cdbdb4d5..e7030cf318 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -641,6 +641,24 @@ int qemuTestDriverInit(virQEMUDriver *driver)
     VIR_FREE(cfg->stateDir);
     VIR_FREE(cfg->configDir);
 
+    /* Override paths to ensure predictable output
+     *
+     * FIXME Find a way to achieve the same result while avoiding all
+     *       the duplicated code
+     */
+    VIR_FREE(cfg->libDir);
+    cfg->libDir = g_strdup("/var/lib/libvirt/qemu");
+    VIR_FREE(cfg->channelTargetDir);
+    cfg->channelTargetDir = g_strdup("/var/lib/libvirt/qemu/channel/target");
+    VIR_FREE(cfg->memoryBackingDir);
+    cfg->memoryBackingDir = g_strdup("/var/lib/libvirt/qemu/ram");
+    VIR_FREE(cfg->nvramDir);
+    cfg->nvramDir = g_strdup("/var/lib/libvirt/qemu/nvram");
+    VIR_FREE(cfg->passtStateDir);
+    cfg->passtStateDir = g_strdup("/var/run/libvirt/qemu/passt");
+    VIR_FREE(cfg->dbusStateDir);
+    cfg->dbusStateDir = g_strdup("/var/run/libvirt/qemu/dbus");
+
     if (!g_mkdtemp(statedir)) {
         fprintf(stderr, "Cannot create fake stateDir");
         goto error;
-- 
2.39.2



More information about the libvir-list mailing list