提交 272be1a8 编写于 作者: G Guido Günther 提交者: Doug Goldstein

qemu: pass "-1" as uid/gid for unprivileged qemu

so we don't try to change uid/git to 0 when probing capabilities.
上级 41046256
...@@ -556,6 +556,8 @@ qemuStartup(bool privileged, ...@@ -556,6 +556,8 @@ qemuStartup(bool privileged,
char *membase = NULL; char *membase = NULL;
char *mempath = NULL; char *mempath = NULL;
virQEMUDriverConfigPtr cfg; virQEMUDriverConfigPtr cfg;
uid_t run_uid = -1;
gid_t run_gid = -1;
if (VIR_ALLOC(qemu_driver) < 0) if (VIR_ALLOC(qemu_driver) < 0)
return -1; return -1;
...@@ -707,11 +709,13 @@ qemuStartup(bool privileged, ...@@ -707,11 +709,13 @@ qemuStartup(bool privileged,
cfg->snapshotDir, cfg->user, cfg->group); cfg->snapshotDir, cfg->user, cfg->group);
goto error; goto error;
} }
run_uid = cfg->user;
run_gid = cfg->group;
} }
qemu_driver->qemuCapsCache = virQEMUCapsCacheNew(cfg->libDir, qemu_driver->qemuCapsCache = virQEMUCapsCacheNew(cfg->libDir,
cfg->user, run_uid,
cfg->group); run_gid);
if (!qemu_driver->qemuCapsCache) if (!qemu_driver->qemuCapsCache)
goto error; goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册