From nobody Sun May 5 14:53:57 2024 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.zoho.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 1491487754850879.1196874572424; Thu, 6 Apr 2017 07:09:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F15F8E3E6; Thu, 6 Apr 2017 14:09:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C74CAA3058; Thu, 6 Apr 2017 14:09:11 +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 BE8E818521C6; Thu, 6 Apr 2017 14:09:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v36E99Xl018219 for ; Thu, 6 Apr 2017 10:09:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id F16189E915; Thu, 6 Apr 2017 14:09:08 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-19.phx2.redhat.com [10.3.116.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFA4F9E8F2 for ; Thu, 6 Apr 2017 14:09:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7F15F8E3E6 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7F15F8E3E6 From: John Ferlan To: libvir-list@redhat.com Date: Thu, 6 Apr 2017 10:08:53 -0400 Message-Id: <20170406140855.31205-2-jferlan@redhat.com> In-Reply-To: <20170406140855.31205-1-jferlan@redhat.com> References: <20170406140855.31205-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] interface: Introduce virInterfaceObjNumOfInterfaces 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 06 Apr 2017 14:09:13 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Unlike other drivers, this is a test driver only API. Still combining the logic of testConnectNumOfInterfaces and testConnectNumOfDefinedInterfac= es makes things a bit easier in the long run. Signed-off-by: John Ferlan --- src/conf/virinterfaceobj.c | 20 ++++++++++++++++++++ src/conf/virinterfaceobj.h | 4 ++++ src/libvirt_private.syms | 1 + src/test/test_driver.c | 24 ++++++------------------ 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c index 3af972b..0407c1f 100644 --- a/src/conf/virinterfaceobj.c +++ b/src/conf/virinterfaceobj.c @@ -215,3 +215,23 @@ virInterfaceObjRemove(virInterfaceObjListPtr interface= s, virInterfaceObjUnlock(interfaces->objs[i]); } } + + +int +virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces, + bool wantActive) +{ + size_t i; + int ninterfaces =3D 0; + + for (i =3D 0; (i < interfaces->count); i++) { + virInterfaceObjPtr obj =3D interfaces->objs[i]; + virInterfaceObjLock(obj); + if ((wantActive && virInterfaceObjIsActive(obj)) || + (!wantActive && !virInterfaceObjIsActive(obj))) + ninterfaces++; + virInterfaceObjUnlock(obj); + } + + return ninterfaces; +} diff --git a/src/conf/virinterfaceobj.h b/src/conf/virinterfaceobj.h index 6c5e2e7..2f07174 100644 --- a/src/conf/virinterfaceobj.h +++ b/src/conf/virinterfaceobj.h @@ -81,4 +81,8 @@ typedef bool (*virInterfaceObjListFilter)(virConnectPtr conn, virInterfaceDefPtr def); =20 +int +virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces, + bool wantActive); + #endif /* __VIRINTERFACEOBJ_H__ */ diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 92083e5..96aacaa 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -938,6 +938,7 @@ virInterfaceObjFindByName; virInterfaceObjListClone; virInterfaceObjListFree; virInterfaceObjLock; +virInterfaceObjNumOfInterfaces; virInterfaceObjRemove; virInterfaceObjUnlock; =20 diff --git a/src/test/test_driver.c b/src/test/test_driver.c index cce4d2d..6910681 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3649,18 +3649,12 @@ testInterfaceObjFindByName(testDriverPtr privconn, static int testConnectNumOfInterfaces(virConnectPtr conn) { testDriverPtr privconn =3D conn->privateData; - size_t i; - int count =3D 0; + int ninterfaces; =20 testDriverLock(privconn); - for (i =3D 0; (i < privconn->ifaces.count); i++) { - virInterfaceObjLock(privconn->ifaces.objs[i]); - if (virInterfaceObjIsActive(privconn->ifaces.objs[i])) - count++; - virInterfaceObjUnlock(privconn->ifaces.objs[i]); - } + ninterfaces =3D virInterfaceObjNumOfInterfaces(&privconn->ifaces, true= ); testDriverUnlock(privconn); - return count; + return ninterfaces; } =20 static int testConnectListInterfaces(virConnectPtr conn, char **const name= s, int nnames) @@ -3695,18 +3689,12 @@ static int testConnectListInterfaces(virConnectPtr = conn, char **const names, int static int testConnectNumOfDefinedInterfaces(virConnectPtr conn) { testDriverPtr privconn =3D conn->privateData; - size_t i; - int count =3D 0; + int ninterfaces; =20 testDriverLock(privconn); - for (i =3D 0; i < privconn->ifaces.count; i++) { - virInterfaceObjLock(privconn->ifaces.objs[i]); - if (!virInterfaceObjIsActive(privconn->ifaces.objs[i])) - count++; - virInterfaceObjUnlock(privconn->ifaces.objs[i]); - } + ninterfaces =3D virInterfaceObjNumOfInterfaces(&privconn->ifaces, fals= e); testDriverUnlock(privconn); - return count; + return ninterfaces; } =20 static int testConnectListDefinedInterfaces(virConnectPtr conn, char **con= st names, int nnames) --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 14:53:57 2024 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.zoho.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 1491487757238999.1871503552117; Thu, 6 Apr 2017 07:09:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C1873E263; Thu, 6 Apr 2017 14:09:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 16971948AE; Thu, 6 Apr 2017 14:09:15 +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 AB7295EC65; Thu, 6 Apr 2017 14:09:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v36E9DEg018229 for ; Thu, 6 Apr 2017 10:09:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C35F90923; Thu, 6 Apr 2017 14:09:13 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-19.phx2.redhat.com [10.3.116.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BAD29EAE7 for ; Thu, 6 Apr 2017 14:09:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9C1873E263 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9C1873E263 From: John Ferlan To: libvir-list@redhat.com Date: Thu, 6 Apr 2017 10:08:54 -0400 Message-Id: <20170406140855.31205-3-jferlan@redhat.com> In-Reply-To: <20170406140855.31205-1-jferlan@redhat.com> References: <20170406140855.31205-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] interface: Introduce virInterfaceObjGetNames 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 06 Apr 2017 14:09:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Unlike other drivers, this is a test driver only API. Still combining the logic of testConnectListInterfaces and testConnectListDefinedInterfaces makes things a bit easier in the long run. Signed-off-by: John Ferlan --- src/conf/virinterfaceobj.c | 34 +++++++++++++++++++++++++++++ src/conf/virinterfaceobj.h | 6 ++++++ src/libvirt_private.syms | 1 + src/test/test_driver.c | 54 +++++++++++-------------------------------= ---- 4 files changed, 53 insertions(+), 42 deletions(-) diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c index 0407c1f..229226a 100644 --- a/src/conf/virinterfaceobj.c +++ b/src/conf/virinterfaceobj.c @@ -235,3 +235,37 @@ virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr = interfaces, =20 return ninterfaces; } + + +int +virInterfaceObjGetNames(virInterfaceObjListPtr interfaces, + bool wantActive, + char **const names, + int maxnames) +{ + int nnames =3D 0; + size_t i; + + for (i =3D 0; i < interfaces->count && nnames < maxnames; i++) { + virInterfaceObjPtr obj =3D interfaces->objs[i]; + virInterfaceObjLock(obj); + if ((wantActive && virInterfaceObjIsActive(obj)) || + (!wantActive && !virInterfaceObjIsActive(obj))) { + if (VIR_STRDUP(names[nnames], obj->def->name) < 0) { + virInterfaceObjUnlock(obj); + goto failure; + } + nnames++; + } + virInterfaceObjUnlock(obj); + } + + return nnames; + + failure: + while (--nnames >=3D 0) + VIR_FREE(names[nnames]); + memset(names, 0, maxnames * sizeof(*names)); + + return -1; +} diff --git a/src/conf/virinterfaceobj.h b/src/conf/virinterfaceobj.h index 2f07174..5b0527d 100644 --- a/src/conf/virinterfaceobj.h +++ b/src/conf/virinterfaceobj.h @@ -85,4 +85,10 @@ int virInterfaceObjNumOfInterfaces(virInterfaceObjListPtr interfaces, bool wantActive); =20 +int +virInterfaceObjGetNames(virInterfaceObjListPtr interfaces, + bool wantActive, + char **const names, + int maxnames); + #endif /* __VIRINTERFACEOBJ_H__ */ diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 96aacaa..88e530c 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -935,6 +935,7 @@ virDomainObjListRename; virInterfaceObjAssignDef; virInterfaceObjFindByMACString; virInterfaceObjFindByName; +virInterfaceObjGetNames; virInterfaceObjListClone; virInterfaceObjListFree; virInterfaceObjLock; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 6910681..4e10eb2 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3657,33 +3657,18 @@ static int testConnectNumOfInterfaces(virConnectPtr= conn) return ninterfaces; } =20 -static int testConnectListInterfaces(virConnectPtr conn, char **const name= s, int nnames) +static int testConnectListInterfaces(virConnectPtr conn, char **const name= s, int maxnames) { testDriverPtr privconn =3D conn->privateData; - int n =3D 0; - size_t i; + int nnames; + + memset(names, 0, maxnames * sizeof(*names)); =20 testDriverLock(privconn); - memset(names, 0, sizeof(*names)*nnames); - for (i =3D 0; (i < privconn->ifaces.count) && (n < nnames); i++) { - virInterfaceObjLock(privconn->ifaces.objs[i]); - if (virInterfaceObjIsActive(privconn->ifaces.objs[i])) { - if (VIR_STRDUP(names[n++], privconn->ifaces.objs[i]->def->name= ) < 0) { - virInterfaceObjUnlock(privconn->ifaces.objs[i]); - goto error; - } - } - virInterfaceObjUnlock(privconn->ifaces.objs[i]); - } + nnames =3D virInterfaceObjGetNames(&privconn->ifaces, true, names, max= names); testDriverUnlock(privconn); =20 - return n; - - error: - for (n =3D 0; n < nnames; n++) - VIR_FREE(names[n]); - testDriverUnlock(privconn); - return -1; + return nnames; } =20 static int testConnectNumOfDefinedInterfaces(virConnectPtr conn) @@ -3697,33 +3682,18 @@ static int testConnectNumOfDefinedInterfaces(virCon= nectPtr conn) return ninterfaces; } =20 -static int testConnectListDefinedInterfaces(virConnectPtr conn, char **con= st names, int nnames) +static int testConnectListDefinedInterfaces(virConnectPtr conn, char **con= st names, int maxnames) { testDriverPtr privconn =3D conn->privateData; - int n =3D 0; - size_t i; + int nnames; + + memset(names, 0, maxnames * sizeof(*names)); =20 testDriverLock(privconn); - memset(names, 0, sizeof(*names)*nnames); - for (i =3D 0; (i < privconn->ifaces.count) && (n < nnames); i++) { - virInterfaceObjLock(privconn->ifaces.objs[i]); - if (!virInterfaceObjIsActive(privconn->ifaces.objs[i])) { - if (VIR_STRDUP(names[n++], privconn->ifaces.objs[i]->def->name= ) < 0) { - virInterfaceObjUnlock(privconn->ifaces.objs[i]); - goto error; - } - } - virInterfaceObjUnlock(privconn->ifaces.objs[i]); - } + nnames =3D virInterfaceObjGetNames(&privconn->ifaces, false, names, ma= xnames); testDriverUnlock(privconn); =20 - return n; - - error: - for (n =3D 0; n < nnames; n++) - VIR_FREE(names[n]); - testDriverUnlock(privconn); - return -1; + return nnames; } =20 static virInterfacePtr testInterfaceLookupByName(virConnectPtr conn, --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 14:53:57 2024 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.zoho.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 1491487767994472.2977401227773; Thu, 6 Apr 2017 07:09:27 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AE95A804EE; Thu, 6 Apr 2017 14:09:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B79AB2410; Thu, 6 Apr 2017 14:09:26 +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 0A68E5EC68; Thu, 6 Apr 2017 14:09:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v36E9Epa018234 for ; Thu, 6 Apr 2017 10:09:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0522E9E8F2; Thu, 6 Apr 2017 14:09:14 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-19.phx2.redhat.com [10.3.116.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9B609E910 for ; Thu, 6 Apr 2017 14:09:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AE95A804EE Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AE95A804EE From: John Ferlan To: libvir-list@redhat.com Date: Thu, 6 Apr 2017 10:08:55 -0400 Message-Id: <20170406140855.31205-4-jferlan@redhat.com> In-Reply-To: <20170406140855.31205-1-jferlan@redhat.com> References: <20170406140855.31205-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] interface: Clean up Interface section of test_driver 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 06 Apr 2017 14:09:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Clean up the code to adhere to more of the standard two spaces between functions, separate lines for type and function name, one argument per line. Signed-off-by: John Ferlan --- src/test/test_driver.c | 81 +++++++++++++++++++++++++++++++++++-----------= ---- 1 file changed, 57 insertions(+), 24 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 4e10eb2..89c7389 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3646,7 +3646,8 @@ testInterfaceObjFindByName(testDriverPtr privconn, } =20 =20 -static int testConnectNumOfInterfaces(virConnectPtr conn) +static int +testConnectNumOfInterfaces(virConnectPtr conn) { testDriverPtr privconn =3D conn->privateData; int ninterfaces; @@ -3657,7 +3658,11 @@ static int testConnectNumOfInterfaces(virConnectPtr = conn) return ninterfaces; } =20 -static int testConnectListInterfaces(virConnectPtr conn, char **const name= s, int maxnames) + +static int +testConnectListInterfaces(virConnectPtr conn, + char **const names, + int maxnames) { testDriverPtr privconn =3D conn->privateData; int nnames; @@ -3671,7 +3676,9 @@ static int testConnectListInterfaces(virConnectPtr co= nn, char **const names, int return nnames; } =20 -static int testConnectNumOfDefinedInterfaces(virConnectPtr conn) + +static int +testConnectNumOfDefinedInterfaces(virConnectPtr conn) { testDriverPtr privconn =3D conn->privateData; int ninterfaces; @@ -3682,7 +3689,11 @@ static int testConnectNumOfDefinedInterfaces(virConn= ectPtr conn) return ninterfaces; } =20 -static int testConnectListDefinedInterfaces(virConnectPtr conn, char **con= st names, int maxnames) + +static int +testConnectListDefinedInterfaces(virConnectPtr conn, + char **const names, + int maxnames) { testDriverPtr privconn =3D conn->privateData; int nnames; @@ -3696,8 +3707,10 @@ static int testConnectListDefinedInterfaces(virConne= ctPtr conn, char **const nam return nnames; } =20 -static virInterfacePtr testInterfaceLookupByName(virConnectPtr conn, - const char *name) + +static virInterfacePtr +testInterfaceLookupByName(virConnectPtr conn, + const char *name) { testDriverPtr privconn =3D conn->privateData; virInterfaceObjPtr iface; @@ -3714,8 +3727,10 @@ static virInterfacePtr testInterfaceLookupByName(vir= ConnectPtr conn, return ret; } =20 -static virInterfacePtr testInterfaceLookupByMACString(virConnectPtr conn, - const char *mac) + +static virInterfacePtr +testInterfaceLookupByMACString(virConnectPtr conn, + const char *mac) { testDriverPtr privconn =3D conn->privateData; virInterfaceObjPtr iface; @@ -3744,7 +3759,9 @@ static virInterfacePtr testInterfaceLookupByMACString= (virConnectPtr conn, return ret; } =20 -static int testInterfaceIsActive(virInterfacePtr iface) + +static int +testInterfaceIsActive(virInterfacePtr iface) { testDriverPtr privconn =3D iface->conn->privateData; virInterfaceObjPtr obj; @@ -3761,8 +3778,10 @@ static int testInterfaceIsActive(virInterfacePtr ifa= ce) return ret; } =20 -static int testInterfaceChangeBegin(virConnectPtr conn, - unsigned int flags) + +static int +testInterfaceChangeBegin(virConnectPtr conn, + unsigned int flags) { testDriverPtr privconn =3D conn->privateData; int ret =3D -1; @@ -3788,8 +3807,10 @@ static int testInterfaceChangeBegin(virConnectPtr co= nn, return ret; } =20 -static int testInterfaceChangeCommit(virConnectPtr conn, - unsigned int flags) + +static int +testInterfaceChangeCommit(virConnectPtr conn, + unsigned int flags) { testDriverPtr privconn =3D conn->privateData; int ret =3D -1; @@ -3816,8 +3837,10 @@ static int testInterfaceChangeCommit(virConnectPtr c= onn, return ret; } =20 -static int testInterfaceChangeRollback(virConnectPtr conn, - unsigned int flags) + +static int +testInterfaceChangeRollback(virConnectPtr conn, + unsigned int flags) { testDriverPtr privconn =3D conn->privateData; int ret =3D -1; @@ -3848,8 +3871,10 @@ static int testInterfaceChangeRollback(virConnectPtr= conn, return ret; } =20 -static char *testInterfaceGetXMLDesc(virInterfacePtr iface, - unsigned int flags) + +static char * +testInterfaceGetXMLDesc(virInterfacePtr iface, + unsigned int flags) { testDriverPtr privconn =3D iface->conn->privateData; virInterfaceObjPtr privinterface; @@ -3869,8 +3894,10 @@ static char *testInterfaceGetXMLDesc(virInterfacePtr= iface, } =20 =20 -static virInterfacePtr testInterfaceDefineXML(virConnectPtr conn, const ch= ar *xmlStr, - unsigned int flags) +static virInterfacePtr +testInterfaceDefineXML(virConnectPtr conn, + const char *xmlStr, + unsigned int flags) { testDriverPtr privconn =3D conn->privateData; virInterfaceDefPtr def; @@ -3897,7 +3924,9 @@ static virInterfacePtr testInterfaceDefineXML(virConn= ectPtr conn, const char *xm return ret; } =20 -static int testInterfaceUndefine(virInterfacePtr iface) + +static int +testInterfaceUndefine(virInterfacePtr iface) { testDriverPtr privconn =3D iface->conn->privateData; virInterfaceObjPtr privinterface; @@ -3914,8 +3943,10 @@ static int testInterfaceUndefine(virInterfacePtr ifa= ce) return ret; } =20 -static int testInterfaceCreate(virInterfacePtr iface, - unsigned int flags) + +static int +testInterfaceCreate(virInterfacePtr iface, + unsigned int flags) { testDriverPtr privconn =3D iface->conn->privateData; virInterfaceObjPtr privinterface; @@ -3941,8 +3972,10 @@ static int testInterfaceCreate(virInterfacePtr iface, return ret; } =20 -static int testInterfaceDestroy(virInterfacePtr iface, - unsigned int flags) + +static int +testInterfaceDestroy(virInterfacePtr iface, + unsigned int flags) { testDriverPtr privconn =3D iface->conn->privateData; virInterfaceObjPtr privinterface; --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list