]> xenbits.xensource.com Git - libvirt.git/commitdiff
Move QEMU capabilities initialization later in QEMU startup
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 24 Jan 2013 18:32:31 +0000 (18:32 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 25 Jan 2013 10:41:48 +0000 (10:41 +0000)
Currently QEMU capabilities are initialized before the QEMU driver
sets ownership on its various directories. The upshot is that if
you change the user/group in the qemu.conf file, libvirtd will fail
to probe QEMU the first time it is run after the config change.
Moving QEMU capabilities initialization to after the chown() calls
fixes this

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/qemu/qemu_driver.c

index 5b9215939b81cd588bec7a9be6630b3a9b2e573a..13bf8542283f37183a41a29fcfed3271dab824d6 100644 (file)
@@ -825,13 +825,6 @@ qemuStartup(bool privileged,
     if (qemuSecurityInit(qemu_driver) < 0)
         goto error;
 
-    qemu_driver->capsCache = qemuCapsCacheNew(qemu_driver->libDir,
-                                              qemu_driver->stateDir,
-                                              qemu_driver->user,
-                                              qemu_driver->group);
-    if (!qemu_driver->capsCache)
-        goto error;
-
     if ((qemu_driver->activePciHostdevs = pciDeviceListNew()) == NULL)
         goto error;
 
@@ -871,6 +864,12 @@ qemuStartup(bool privileged,
         }
     }
 
+    qemu_driver->capsCache = qemuCapsCacheNew(qemu_driver->libDir,
+                                              qemu_driver->user,
+                                              qemu_driver->group);
+    if (!qemu_driver->capsCache)
+        goto error;
+
     if ((qemu_driver->caps = qemuCreateCapabilities(qemu_driver)) == NULL)
         goto error;