]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Undo recent breakages
authorAndrea Bolognani <abologna@redhat.com>
Mon, 6 Mar 2023 14:25:22 +0000 (15:25 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 6 Mar 2023 15:40:14 +0000 (16:40 +0100)
Turns out that those overrides I recently removed where actually
there for a reason, and there was a motivation behind creating
the driver config as unprivileged too O:-)

Until a solution that can both ensure predictable output and
avoid code duplication is developed, go back to the previous
approach.

Fixes: 2f56f69f7f7e ("tests: Create privileged config for QEMU driver")
Fixes: 0f49b6cc6b81 ("tests: Drop no longer necessary overrides")
Fixes: 0b464cd84ff3 ("tests: Drop more QEMU driver config overrides")
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
tests/testutilsqemu.c

index d3cdbdb4d5172f6317964ea9e31485a34e57a132..d715252aee65a08db8f5c4bb26a8f4002ffdac68 100644 (file)
@@ -631,7 +631,7 @@ int qemuTestDriverInit(virQEMUDriver *driver)
 
     driver->hostarch = virArchFromHost();
 
-    cfg = virQEMUDriverConfigNew(true, NULL);
+    cfg = virQEMUDriverConfigNew(false, NULL);
     if (!cfg)
         goto error;
     driver->config = cfg;
@@ -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
+     *       code duplication
+     */
+    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;