1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

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

so we don't try to change uid/git to 0 when probing capabilities.
This commit is contained in:
Guido Günther 2013-02-17 18:33:08 +01:00 committed by Doug Goldstein
parent 41046256fe
commit 272be1a840

View File

@ -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,
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;