[libvirt] [PATCH] Move QEMU capabilities initialization later in QEMU startup

2013-01-24 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com

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 berra...@redhat.com
---
 src/qemu/qemu_driver.c | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 1f43d54..9ff920e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -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;
 
-- 
1.8.0.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] Move QEMU capabilities initialization later in QEMU startup

2013-01-24 Thread Laine Stump
On 01/24/2013 01:34 PM, Daniel P. Berrange wrote:
 From: Daniel P. Berrange berra...@redhat.com

 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 berra...@redhat.com
 ---
  src/qemu/qemu_driver.c | 13 ++---
  1 file changed, 6 insertions(+), 7 deletions(-)

ACK.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list