From nobody Mon Feb 9 01:45:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1488633457671697.5200448064478; Sat, 4 Mar 2017 05:17:37 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v24DDOXf056899; Sat, 4 Mar 2017 08:13:24 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v24DCgsO029280 for ; Sat, 4 Mar 2017 08:12:42 -0500 Received: from localhost.localdomain.com (ovpn-116-78.phx2.redhat.com [10.3.116.78]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v24DCe04009154 for ; Sat, 4 Mar 2017 08:12:41 -0500 From: John Ferlan To: libvir-list@redhat.com Date: Sat, 4 Mar 2017 08:12:33 -0500 Message-Id: <20170304131235.2057-3-jferlan@redhat.com> In-Reply-To: <20170304131235.2057-1-jferlan@redhat.com> References: <20170304131235.2057-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] conf: Adjust coding style for interface conf sources 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Alter the format of the code to follow more recent style guidelines of two empty lines between functions, function decls with "[static] type" on one line followed by function name with arguments to functions each on one line. Signed-off-by: John Ferlan --- src/conf/interface_conf.c | 73 ++++++++++++++++++++++++++++++++++++------= ---- src/conf/virinterfaceobj.c | 48 ++++++++++++++++++++---------- 2 files changed, 89 insertions(+), 32 deletions(-) diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index dc2ddd4..8c46cf5 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -40,12 +40,13 @@ VIR_ENUM_IMPL(virInterface, =20 static virInterfaceDefPtr virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType); + static int virInterfaceDefDevFormat(virBufferPtr buf, const virInterfaceDef *def, virInterfaceType parentIfType); =20 -static -void virInterfaceIPDefFree(virInterfaceIPDefPtr def) +static void +virInterfaceIPDefFree(virInterfaceIPDefPtr def) { if (def =3D=3D NULL) return; @@ -53,8 +54,9 @@ void virInterfaceIPDefFree(virInterfaceIPDefPtr def) VIR_FREE(def); } =20 -static -void virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def) + +static void +virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def) { size_t i; =20 @@ -68,7 +70,9 @@ void virInterfaceProtocolDefFree(virInterfaceProtocolDefP= tr def) VIR_FREE(def); } =20 -void virInterfaceDefFree(virInterfaceDefPtr def) + +void +virInterfaceDefFree(virInterfaceDefPtr def) { size_t i; int pp; @@ -111,6 +115,7 @@ void virInterfaceDefFree(virInterfaceDefPtr def) VIR_FREE(def); } =20 + static int virInterfaceDefParseName(virInterfaceDefPtr def, xmlXPathContextPtr ctxt) @@ -127,6 +132,7 @@ virInterfaceDefParseName(virInterfaceDefPtr def, return 0; } =20 + static int virInterfaceDefParseMtu(virInterfaceDefPtr def, xmlXPathContextPtr ctxt) @@ -145,6 +151,7 @@ virInterfaceDefParseMtu(virInterfaceDefPtr def, return 0; } =20 + static int virInterfaceDefParseStartMode(virInterfaceDefPtr def, xmlXPathContextPtr ctxt) @@ -170,6 +177,7 @@ virInterfaceDefParseStartMode(virInterfaceDefPtr def, return 0; } =20 + static int virInterfaceDefParseBondMode(xmlXPathContextPtr ctxt) { @@ -202,6 +210,7 @@ virInterfaceDefParseBondMode(xmlXPathContextPtr ctxt) return ret; } =20 + static int virInterfaceDefParseBondMiiCarrier(xmlXPathContextPtr ctxt) { @@ -224,6 +233,7 @@ virInterfaceDefParseBondMiiCarrier(xmlXPathContextPtr c= txt) return ret; } =20 + static int virInterfaceDefParseBondArpValid(xmlXPathContextPtr ctxt) { @@ -248,6 +258,7 @@ virInterfaceDefParseBondArpValid(xmlXPathContextPtr ctx= t) return ret; } =20 + static int virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def, xmlNodePtr dhcp, xmlXPathContextPtr ctxt) @@ -280,6 +291,7 @@ virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def, return ret; } =20 + static int virInterfaceDefParseIP(virInterfaceIPDefPtr def, xmlXPathContextPtr ctxt) @@ -304,6 +316,7 @@ virInterfaceDefParseIP(virInterfaceIPDefPtr def, return 0; } =20 + static int virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def, xmlXPathContextPtr ctxt) @@ -355,6 +368,7 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPt= r def, return ret; } =20 + static int virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def, xmlXPathContextPtr ctxt) @@ -410,6 +424,7 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPt= r def, return ret; } =20 + static int virInterfaceDefParseIfAdressing(virInterfaceDefPtr def, xmlXPathContextPtr ctxt) @@ -480,6 +495,7 @@ virInterfaceDefParseIfAdressing(virInterfaceDefPtr def, =20 } =20 + static int virInterfaceDefParseBridge(virInterfaceDefPtr def, xmlXPathContextPtr ctxt) @@ -539,6 +555,7 @@ virInterfaceDefParseBridge(virInterfaceDefPtr def, return ret; } =20 + static int virInterfaceDefParseBondItfs(virInterfaceDefPtr def, xmlXPathContextPtr ctxt) @@ -581,6 +598,7 @@ virInterfaceDefParseBondItfs(virInterfaceDefPtr def, return ret; } =20 + static int virInterfaceDefParseBond(virInterfaceDefPtr def, xmlXPathContextPtr ctxt) @@ -653,6 +671,7 @@ virInterfaceDefParseBond(virInterfaceDefPtr def, return 0; } =20 + static int virInterfaceDefParseVlan(virInterfaceDefPtr def, xmlXPathContextPtr ctxt) @@ -674,8 +693,10 @@ virInterfaceDefParseVlan(virInterfaceDefPtr def, return 0; } =20 + static virInterfaceDefPtr -virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType) +virInterfaceDefParseXML(xmlXPathContextPtr ctxt, + int parentIfType) { virInterfaceDefPtr def; int type; @@ -795,8 +816,10 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int p= arentIfType) return NULL; } =20 -virInterfaceDefPtr virInterfaceDefParseNode(xmlDocPtr xml, - xmlNodePtr root) + +virInterfaceDefPtr +virInterfaceDefParseNode(xmlDocPtr xml, + xmlNodePtr root) { xmlXPathContextPtr ctxt =3D NULL; virInterfaceDefPtr def =3D NULL; @@ -823,6 +846,7 @@ virInterfaceDefPtr virInterfaceDefParseNode(xmlDocPtr x= ml, return def; } =20 + static virInterfaceDefPtr virInterfaceDefParse(const char *xmlStr, const char *filename) @@ -838,18 +862,24 @@ virInterfaceDefParse(const char *xmlStr, return def; } =20 -virInterfaceDefPtr virInterfaceDefParseString(const char *xmlStr) + +virInterfaceDefPtr +virInterfaceDefParseString(const char *xmlStr) { return virInterfaceDefParse(xmlStr, NULL); } =20 -virInterfaceDefPtr virInterfaceDefParseFile(const char *filename) + +virInterfaceDefPtr +virInterfaceDefParseFile(const char *filename) { return virInterfaceDefParse(NULL, filename); } =20 + static int -virInterfaceBridgeDefFormat(virBufferPtr buf, const virInterfaceDef *def) +virInterfaceBridgeDefFormat(virBufferPtr buf, + const virInterfaceDef *def) { size_t i; int ret =3D 0; @@ -875,8 +905,10 @@ virInterfaceBridgeDefFormat(virBufferPtr buf, const vi= rInterfaceDef *def) return ret; } =20 + static int -virInterfaceBondDefFormat(virBufferPtr buf, const virInterfaceDef *def) +virInterfaceBondDefFormat(virBufferPtr buf, + const virInterfaceDef *def) { size_t i; int ret =3D 0; @@ -938,8 +970,10 @@ virInterfaceBondDefFormat(virBufferPtr buf, const virI= nterfaceDef *def) return ret; } =20 + static int -virInterfaceVlanDefFormat(virBufferPtr buf, const virInterfaceDef *def) +virInterfaceVlanDefFormat(virBufferPtr buf, + const virInterfaceDef *def) { if (def->data.vlan.tag =3D=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -961,8 +995,10 @@ virInterfaceVlanDefFormat(virBufferPtr buf, const virI= nterfaceDef *def) return 0; } =20 + static int -virInterfaceProtocolDefFormat(virBufferPtr buf, const virInterfaceDef *def) +virInterfaceProtocolDefFormat(virBufferPtr buf, + const virInterfaceDef *def) { size_t i, j; =20 @@ -1006,6 +1042,7 @@ virInterfaceProtocolDefFormat(virBufferPtr buf, const= virInterfaceDef *def) return 0; } =20 + static int virInterfaceStartmodeDefFormat(virBufferPtr buf, virInterfaceStartMode startmode) @@ -1032,8 +1069,10 @@ virInterfaceStartmodeDefFormat(virBufferPtr buf, return 0; } =20 + static int -virInterfaceDefDevFormat(virBufferPtr buf, const virInterfaceDef *def, +virInterfaceDefDevFormat(virBufferPtr buf, + const virInterfaceDef *def, virInterfaceType parentIfType) { const char *type =3D NULL; @@ -1104,7 +1143,9 @@ virInterfaceDefDevFormat(virBufferPtr buf, const virI= nterfaceDef *def, return -1; } =20 -char *virInterfaceDefFormat(const virInterfaceDef *def) + +char * +virInterfaceDefFormat(const virInterfaceDef *def) { virBuffer buf =3D VIR_BUFFER_INITIALIZER; =20 diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c index 6c18911..70f9001 100644 --- a/src/conf/virinterfaceobj.c +++ b/src/conf/virinterfaceobj.c @@ -36,17 +36,22 @@ VIR_LOG_INIT("conf.virinterfaceobj"); =20 /* virInterfaceObj manipulation */ =20 -void virInterfaceObjLock(virInterfaceObjPtr obj) +void +virInterfaceObjLock(virInterfaceObjPtr obj) { virMutexLock(&obj->lock); } =20 -void virInterfaceObjUnlock(virInterfaceObjPtr obj) + +void +virInterfaceObjUnlock(virInterfaceObjPtr obj) { virMutexUnlock(&obj->lock); } =20 -void virInterfaceObjFree(virInterfaceObjPtr iface) + +void +virInterfaceObjFree(virInterfaceObjPtr iface) { if (!iface) return; @@ -56,11 +61,12 @@ void virInterfaceObjFree(virInterfaceObjPtr iface) VIR_FREE(iface); } =20 -/* virInterfaceObjList manipulation */ =20 -int virInterfaceFindByMACString(virInterfaceObjListPtr interfaces, - const char *mac, - virInterfaceObjPtr *matches, int maxmatche= s) +/* virInterfaceObjList manipulation */ +int +virInterfaceFindByMACString(virInterfaceObjListPtr interfaces, + const char *mac, + virInterfaceObjPtr *matches, int maxmatches) { size_t i; unsigned int matchct =3D 0; @@ -83,8 +89,10 @@ int virInterfaceFindByMACString(virInterfaceObjListPtr i= nterfaces, return matchct; } =20 -virInterfaceObjPtr virInterfaceFindByName(virInterfaceObjListPtr interface= s, - const char *name) + +virInterfaceObjPtr +virInterfaceFindByName(virInterfaceObjListPtr interfaces, + const char *name) { size_t i; =20 @@ -98,7 +106,9 @@ virInterfaceObjPtr virInterfaceFindByName(virInterfaceOb= jListPtr interfaces, return NULL; } =20 -void virInterfaceObjListFree(virInterfaceObjListPtr interfaces) + +void +virInterfaceObjListFree(virInterfaceObjListPtr interfaces) { size_t i; =20 @@ -109,8 +119,10 @@ void virInterfaceObjListFree(virInterfaceObjListPtr in= terfaces) interfaces->count =3D 0; } =20 -int virInterfaceObjListClone(virInterfaceObjListPtr src, - virInterfaceObjListPtr dest) + +int +virInterfaceObjListClone(virInterfaceObjListPtr src, + virInterfaceObjListPtr dest) { int ret =3D -1; size_t i; @@ -148,8 +160,10 @@ int virInterfaceObjListClone(virInterfaceObjListPtr sr= c, return ret; } =20 -virInterfaceObjPtr virInterfaceAssignDef(virInterfaceObjListPtr interfaces, - virInterfaceDefPtr def) + +virInterfaceObjPtr +virInterfaceAssignDef(virInterfaceObjListPtr interfaces, + virInterfaceDefPtr def) { virInterfaceObjPtr iface; =20 @@ -181,8 +195,10 @@ virInterfaceObjPtr virInterfaceAssignDef(virInterfaceO= bjListPtr interfaces, =20 } =20 -void virInterfaceRemove(virInterfaceObjListPtr interfaces, - virInterfaceObjPtr iface) + +void +virInterfaceRemove(virInterfaceObjListPtr interfaces, + virInterfaceObjPtr iface) { size_t i; =20 --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list