[libvirt] [RFC PATCHv2 4/4] storage: Change hardcoded QEMU connection to use config driver

Adam Walters adam at pandorasboxen.com
Thu Jan 23 20:14:23 UTC 2014


This utilizes the new config driver I am submitting to resolve the
hardcoded QEMU connection string in the storage driver. With this, the
storage driver no longer has a circular dependency with QEMU. Without
this patch, when libvirtd is restarted, QEMU requires storage (when
domains are using storage pool backings), and storage requires QEMU (for
access to secrets). This causes issues during libvirtd startup.

Signed-off-by: Adam Walters <adam at pandorasboxen.com>
---
 src/storage/storage_driver.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index d753e34..a86d564 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -70,12 +70,13 @@ storageDriverAutostart(virStorageDriverStatePtr driver) {
     size_t i;
     virConnectPtr conn = NULL;
 
-    /* XXX Remove hardcoding of QEMU URI */
-    if (driverState->privileged)
-        conn = virConnectOpen("qemu:///system");
-    else
-        conn = virConnectOpen("qemu:///session");
-    /* Ignoring NULL conn - let backends decide */
+    conn = virConnectOpen("config:///");
+    /* Ignoring NULL conn - let backends decide.
+     * As long as the config driver is built, and
+     * it should be, since it is default on and
+     * not configurable, a NULL conn should never
+     * happen.
+     */
 
     for (i = 0; i < driver->pools.count; i++) {
         virStoragePoolObjPtr pool = driver->pools.objs[i];
-- 
1.8.5.2




More information about the libvir-list mailing list