1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-10 05:17:59 +03:00

tests: Undo recent breakages

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: 2f56f69f7f ("tests: Create privileged config for QEMU driver")
Fixes: 0f49b6cc6b ("tests: Drop no longer necessary overrides")
Fixes: 0b464cd84f ("tests: Drop more QEMU driver config overrides")
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Andrea Bolognani 2023-03-06 15:25:22 +01:00
parent 0b464cd84f
commit e6c1ca3d11

View 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;