]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: pass "-1" as uid/gid for unprivileged qemu
authorGuido Günther <agx@sigxcpu.org>
Sun, 17 Feb 2013 17:33:08 +0000 (18:33 +0100)
committerDoug Goldstein <cardoe@cardoe.com>
Mon, 18 Feb 2013 18:08:38 +0000 (12:08 -0600)
so we don't try to change uid/git to 0 when probing capabilities.

src/qemu/qemu_driver.c

index 23499ef842a73d21b71f6e479074ccf1ad990c43..dc35b9115b69cd92fa7b922822759c95624951ba 100644 (file)
@@ -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;