As mentioned in one of previous commits, populating domain's
namespace from pre-exec() hook is dangerous. This commit moves
population of the namespace with domain graphics (render node)
into daemon's namespace.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain_namespace.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_domain_namespace.c b/src/qemu/qemu_domain_namespace.c
index 138dc63489..8a77c067c8 100644
--- a/src/qemu/qemu_domain_namespace.c
+++ b/src/qemu/qemu_domain_namespace.c
@@ -701,27 +701,27 @@ qemuDomainSetupAllTPMs(virDomainObjPtr vm,
static int
qemuDomainSetupGraphics(virDomainGraphicsDefPtr gfx,
- const struct qemuDomainCreateDeviceData *data)
+ char ***paths)
{
const char *rendernode = virDomainGraphicsGetRenderNode(gfx);
if (!rendernode)
return 0;
- return qemuDomainCreateDevice(rendernode, data, false);
+ return virStringListAdd(paths, rendernode);
}
static int
qemuDomainSetupAllGraphics(virDomainObjPtr vm,
- const struct qemuDomainCreateDeviceData *data)
+ char ***paths)
{
size_t i;
VIR_DEBUG("Setting up graphics");
for (i = 0; i < vm->def->ngraphics; i++) {
if (qemuDomainSetupGraphics(vm->def->graphics[i],
- data) < 0)
+ paths) < 0)
return -1;
}
@@ -882,6 +882,9 @@ qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg,
if (qemuDomainSetupAllTPMs(vm, &paths) < 0)
return -1;
+ if (qemuDomainSetupAllGraphics(vm, &paths) < 0)
+ return -1;
+
if (qemuDomainNamespaceMknodPaths(vm, (const char **) paths) < 0)
return -1;
@@ -933,9 +936,6 @@ qemuDomainUnshareNamespace(virQEMUDriverConfigPtr cfg,
if (qemuDomainSetupDev(mgr, vm, devPath) < 0)
goto cleanup;
- if (qemuDomainSetupAllGraphics(vm, &data) < 0)
- goto cleanup;
-
if (qemuDomainSetupAllInputs(vm, &data) < 0)
goto cleanup;
--
2.26.2