From 272be1a84074cdb48e46b866cd9374f097709a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sun, 17 Feb 2013 18:33:08 +0100 Subject: [PATCH] qemu: pass "-1" as uid/gid for unprivileged qemu so we don't try to change uid/git to 0 when probing capabilities. --- src/qemu/qemu_driver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 23499ef842..dc35b9115b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -556,6 +556,8 @@ qemuStartup(bool privileged, char *membase = NULL; char *mempath = NULL; virQEMUDriverConfigPtr cfg; + uid_t run_uid = -1; + gid_t run_gid = -1; if (VIR_ALLOC(qemu_driver) < 0) return -1; @@ -707,11 +709,13 @@ qemuStartup(bool privileged, cfg->snapshotDir, cfg->user, cfg->group); goto error; } + run_uid = cfg->user; + run_gid = cfg->group; } qemu_driver->qemuCapsCache = virQEMUCapsCacheNew(cfg->libDir, - cfg->user, - cfg->group); + run_uid, + run_gid); if (!qemu_driver->qemuCapsCache) goto error;