By default, qemu user's home dir points to '/' which shouldn't be used
at all. We therefore pass the HOME variable from the current variable
iff not running as SUID, which means that for systemd we never set it.
This patch makes sure, that for system QEMU this is always set to
libDir/<driver>, session mode is left untouched.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
src/qemu/qemu_command.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 23be0d8554..26c36d2e19 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10671,6 +10671,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
virCommandAddEnvFormat(cmd, "XDG_CACHE_HOME=%s/%s",
priv->libDir, ".cache");
} else {
+ virCommandAddEnvPair(cmd, "HOME", priv->libDir);
virCommandAddEnvXDG(cmd, priv->libDir);
}
--
2.20.1