From nobody Wed May 14 21:42:25 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1516973752270784.431955157383; Fri, 26 Jan 2018 05:35:52 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88D11780DA; Fri, 26 Jan 2018 13:35:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 087265D724; Fri, 26 Jan 2018 13:35:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 304743FB18; Fri, 26 Jan 2018 13:35:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0QDZkUE025169 for ; Fri, 26 Jan 2018 08:35:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id C92E5649B2; Fri, 26 Jan 2018 13:35:46 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37CC975A1B; Fri, 26 Jan 2018 13:35:45 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 26 Jan 2018 13:35:30 +0000 Message-Id: <20180126133537.31883-4-berrange@redhat.com> In-Reply-To: <20180126133537.31883-1-berrange@redhat.com> References: <20180126133537.31883-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/10] network: move driver registration back to end of the file X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 26 Jan 2018 13:35:51 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 By convention the last thing in the driver.c files should be the driver callback table and function to register it. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/network/bridge_driver.c | 90 ++++++++++++++++++++++-------------------= ---- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 334da7a85d..7f21381bd4 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -4241,51 +4241,6 @@ networkGetDHCPLeases(virNetworkPtr net, } =20 =20 -static virNetworkDriver networkDriver =3D { - .name =3D "bridge", - .connectNumOfNetworks =3D networkConnectNumOfNetworks, /* 0.2.0 */ - .connectListNetworks =3D networkConnectListNetworks, /* 0.2.0 */ - .connectNumOfDefinedNetworks =3D networkConnectNumOfDefinedNetworks, /= * 0.2.0 */ - .connectListDefinedNetworks =3D networkConnectListDefinedNetworks, /* = 0.2.0 */ - .connectListAllNetworks =3D networkConnectListAllNetworks, /* 0.10.2 */ - .connectNetworkEventRegisterAny =3D networkConnectNetworkEventRegister= Any, /* 1.2.1 */ - .connectNetworkEventDeregisterAny =3D networkConnectNetworkEventDeregi= sterAny, /* 1.2.1 */ - .networkLookupByUUID =3D networkLookupByUUID, /* 0.2.0 */ - .networkLookupByName =3D networkLookupByName, /* 0.2.0 */ - .networkCreateXML =3D networkCreateXML, /* 0.2.0 */ - .networkDefineXML =3D networkDefineXML, /* 0.2.0 */ - .networkUndefine =3D networkUndefine, /* 0.2.0 */ - .networkUpdate =3D networkUpdate, /* 0.10.2 */ - .networkCreate =3D networkCreate, /* 0.2.0 */ - .networkDestroy =3D networkDestroy, /* 0.2.0 */ - .networkGetXMLDesc =3D networkGetXMLDesc, /* 0.2.0 */ - .networkGetBridgeName =3D networkGetBridgeName, /* 0.2.0 */ - .networkGetAutostart =3D networkGetAutostart, /* 0.2.1 */ - .networkSetAutostart =3D networkSetAutostart, /* 0.2.1 */ - .networkIsActive =3D networkIsActive, /* 0.7.3 */ - .networkIsPersistent =3D networkIsPersistent, /* 0.7.3 */ - .networkGetDHCPLeases =3D networkGetDHCPLeases, /* 1.2.6 */ -}; - -static virStateDriver networkStateDriver =3D { - .name =3D "bridge", - .stateInitialize =3D networkStateInitialize, - .stateAutoStart =3D networkStateAutoStart, - .stateCleanup =3D networkStateCleanup, - .stateReload =3D networkStateReload, -}; - -int -networkRegister(void) -{ - if (virSetSharedNetworkDriver(&networkDriver) < 0) - return -1; - if (virRegisterStateDriver(&networkStateDriver) < 0) - return -1; - return 0; -} - - /* A unified function to log network connections and disconnections */ =20 static void @@ -5716,3 +5671,48 @@ networkBandwidthUpdate(virDomainNetDefPtr iface, virNetworkObjEndAPI(&obj); return ret; } + + +static virNetworkDriver networkDriver =3D { + .name =3D "bridge", + .connectNumOfNetworks =3D networkConnectNumOfNetworks, /* 0.2.0 */ + .connectListNetworks =3D networkConnectListNetworks, /* 0.2.0 */ + .connectNumOfDefinedNetworks =3D networkConnectNumOfDefinedNetworks, /= * 0.2.0 */ + .connectListDefinedNetworks =3D networkConnectListDefinedNetworks, /* = 0.2.0 */ + .connectListAllNetworks =3D networkConnectListAllNetworks, /* 0.10.2 */ + .connectNetworkEventRegisterAny =3D networkConnectNetworkEventRegister= Any, /* 1.2.1 */ + .connectNetworkEventDeregisterAny =3D networkConnectNetworkEventDeregi= sterAny, /* 1.2.1 */ + .networkLookupByUUID =3D networkLookupByUUID, /* 0.2.0 */ + .networkLookupByName =3D networkLookupByName, /* 0.2.0 */ + .networkCreateXML =3D networkCreateXML, /* 0.2.0 */ + .networkDefineXML =3D networkDefineXML, /* 0.2.0 */ + .networkUndefine =3D networkUndefine, /* 0.2.0 */ + .networkUpdate =3D networkUpdate, /* 0.10.2 */ + .networkCreate =3D networkCreate, /* 0.2.0 */ + .networkDestroy =3D networkDestroy, /* 0.2.0 */ + .networkGetXMLDesc =3D networkGetXMLDesc, /* 0.2.0 */ + .networkGetBridgeName =3D networkGetBridgeName, /* 0.2.0 */ + .networkGetAutostart =3D networkGetAutostart, /* 0.2.1 */ + .networkSetAutostart =3D networkSetAutostart, /* 0.2.1 */ + .networkIsActive =3D networkIsActive, /* 0.7.3 */ + .networkIsPersistent =3D networkIsPersistent, /* 0.7.3 */ + .networkGetDHCPLeases =3D networkGetDHCPLeases, /* 1.2.6 */ +}; + +static virStateDriver networkStateDriver =3D { + .name =3D "bridge", + .stateInitialize =3D networkStateInitialize, + .stateAutoStart =3D networkStateAutoStart, + .stateCleanup =3D networkStateCleanup, + .stateReload =3D networkStateReload, +}; + +int +networkRegister(void) +{ + if (virSetSharedNetworkDriver(&networkDriver) < 0) + return -1; + if (virRegisterStateDriver(&networkStateDriver) < 0) + return -1; + return 0; +} --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list