From: Peter Krempa Date: Tue, 28 Jun 2022 14:45:01 +0000 (+0200) Subject: virLXCProcessAutostartAll: Remove unused 'conn' X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5cd1656463a86f0950bb2405da89d0e15dc43dc0;p=libvirt.git 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 --- 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); }