From 5cd1656463a86f0950bb2405da89d0e15dc43dc0 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 28 Jun 2022 16:45:01 +0200 Subject: [PATCH] virLXCProcessAutostartAll: Remove unused 'conn' The connection object is not needed when autostarting containers so we can remove the machinery for it. Signed-off-by: Peter Krempa Reviewed-by: Tim Wiederhake --- 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); }