From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Location of DBus daemon state configuration, socket, pid...
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
src/qemu/qemu_conf.c | 8 ++++++++
src/qemu/qemu_conf.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 6f15ce2086..5f6f93d828 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -149,6 +149,10 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
"%s/run/libvirt/qemu/swtpm", LOCALSTATEDIR) < 0)
goto error;
+ if (virAsprintf(&cfg->dbusStateDir,
+ "%s/run/libvirt/qemu/dbus", LOCALSTATEDIR) < 0)
+ goto error;
+
if (virAsprintf(&cfg->cacheDir,
"%s/cache/libvirt/qemu", LOCALSTATEDIR) < 0)
goto error;
@@ -214,6 +218,9 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
if (virAsprintf(&cfg->swtpmStateDir, "%s/swtpm",
cfg->stateDir) < 0)
goto error;
+ if (virAsprintf(&cfg->dbusStateDir, "%s/dbus", cfg->stateDir)
< 0)
+ goto error;
+
if (!(cfg->configBaseDir = virGetUserConfigDirectory()))
goto error;
@@ -331,6 +338,7 @@ static void virQEMUDriverConfigDispose(void *obj)
VIR_FREE(cfg->swtpmLogDir);
VIR_FREE(cfg->stateDir);
VIR_FREE(cfg->swtpmStateDir);
+ VIR_FREE(cfg->dbusStateDir);
VIR_FREE(cfg->libDir);
VIR_FREE(cfg->cacheDir);
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 0799846001..c87cb8bc41 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -95,6 +95,7 @@ struct _virQEMUDriverConfig {
char *swtpmLogDir;
char *stateDir;
char *swtpmStateDir;
+ char *dbusStateDir;
/* These two directories are ones QEMU processes use (so must match
* the QEMU user/group */
char *libDir;
--
2.22.0.214.g8dca754b1e