On 8/8/19 4:55 PM, marcandre.lureau(a)redhat.com wrote:
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
src/qemu/qemu_conf.c | 4 ++++
src/qemu/qemu_conf.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 4b84cb6dea..7d2e84b5bb 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -216,6 +216,9 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
if (virAsprintf(&cfg->swtpmStateDir, "%s/swtpm",
cfg->stateDir) < 0)
goto error;
+ if (virAsprintf(&cfg->slirpStateDir, "%s/slirp",
cfg->stateDir) < 0)
+ goto error;
+
if (!(cfg->configBaseDir = virGetUserConfigDirectory()))
goto error;
Missing initialization for @privileged == true case. Although, if you do
this outside of this if() statement, then you don't need to worry.
@@ -335,6 +338,7 @@ static void virQEMUDriverConfigDispose(void *obj)
VIR_FREE(cfg->swtpmLogDir);
VIR_FREE(cfg->stateDir);
VIR_FREE(cfg->swtpmStateDir);
+ VIR_FREE(cfg->slirpStateDir);
VIR_FREE(cfg->libDir);
VIR_FREE(cfg->cacheDir);
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index a85ae50e14..8473d6d4ca 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -96,6 +96,7 @@ struct _virQEMUDriverConfig {
char *swtpmLogDir;
char *stateDir;
char *swtpmStateDir;
+ char *slirpStateDir;
/* These two directories are ones QEMU processes use (so must match
* the QEMU user/group */
char *libDir;
Also, what is missing is the dir creation and chown() that should be
done in qemuStateInitialize().
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
Michal