[PATCH 4/7] virLXCProcessAutostartAll: Remove unused 'conn'

Peter Krempa pkrempa at redhat.com
Tue Jul 19 10:45:26 UTC 2022


The connection object is not needed when autostarting containers so we
can remove the machinery for it.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/lxc/lxc_process.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 130c16aa04..a733f146f4 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -1540,7 +1540,6 @@ int virLXCProcessStart(virLXCDriver * driver,

 struct virLXCProcessAutostartData {
     virLXCDriver *driver;
-    virConnectPtr conn;
 };

 static int
@@ -1576,21 +1575,11 @@ virLXCProcessAutostartDomain(virDomainObj *vm,
 void
 virLXCProcessAutostartAll(virLXCDriver *driver)
 {
-    /* XXX: Figure out a better way todo this. The domain
-     * startup code needs a connection handle in order
-     * to lookup the bridge associated with a virtual
-     * network
-     */
-    virConnectPtr conn = virConnectOpen("lxc:///system");
-    /* Ignoring NULL conn which is mostly harmless here */
-
-    struct virLXCProcessAutostartData data = { driver, conn };
+    struct virLXCProcessAutostartData data = { driver };

     virDomainObjListForEach(driver->domains, false,
                             virLXCProcessAutostartDomain,
                             &data);
-
-    virObjectUnref(conn);
 }


-- 
2.36.1



More information about the libvir-list mailing list