]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Only initialize capabilities after setting dir permissions
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 7 Jan 2013 16:18:33 +0000 (16:18 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 7 Jan 2013 18:13:39 +0000 (18:13 +0000)
The current code is initializing capabilities before setting
directory permissions. Thus the QEMU binaries being run may
not have the ability to create the UNIX monitor socket on
the first run of libvirtd.

src/qemu/qemu_driver.c

index b857892039d791c99d2db9de6e8dfa0a17d70b6c..06b0d28efb194e5c78f384a1977c3146d3151127 100644 (file)
@@ -831,9 +831,6 @@ qemuStartup(bool privileged,
     if (!qemu_driver->capsCache)
         goto error;
 
-    if ((qemu_driver->caps = qemuCreateCapabilities(qemu_driver)) == NULL)
-        goto error;
-
     if ((qemu_driver->activePciHostdevs = pciDeviceListNew()) == NULL)
         goto error;
 
@@ -873,6 +870,9 @@ qemuStartup(bool privileged,
         }
     }
 
+    if ((qemu_driver->caps = qemuCreateCapabilities(qemu_driver)) == NULL)
+        goto error;
+
     /* If hugetlbfs is present, then we need to create a sub-directory within
      * it, since we can't assume the root mount point has permissions that
      * will let our spawned QEMU instances use it.