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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx>
---
 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

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]