From nobody Thu May 15 22:37:39 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 1500559721752876.2391919940445; Thu, 20 Jul 2017 07:08:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 043404A71C; Thu, 20 Jul 2017 14:08:34 +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 CF9FA80A45; Thu, 20 Jul 2017 14:08:33 +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 88E814A491; Thu, 20 Jul 2017 14:08:33 +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 v6KE8Jvx023834 for ; Thu, 20 Jul 2017 10:08:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 81A4A17F23; Thu, 20 Jul 2017 14:08:19 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-117-46.phx2.redhat.com [10.3.117.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42CCB6BF6D for ; Thu, 20 Jul 2017 14:08:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 043404A71C Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.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 043404A71C From: John Ferlan To: libvir-list@redhat.com Date: Thu, 20 Jul 2017 10:08:13 -0400 Message-Id: <20170720140815.16411-3-jferlan@redhat.com> In-Reply-To: <20170720140815.16411-1-jferlan@redhat.com> References: <20170720140815.16411-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v6 2/4] nodedev: Remove @create from virNodeDeviceObjListGetParentHost 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 20 Jul 2017 14:08:34 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The only callers to this function are from CreateXML paths now, so let's just remove the unnecessary parameter. Signed-off-by: John Ferlan --- src/conf/virnodedeviceobj.c | 5 ++--- src/conf/virnodedeviceobj.h | 3 +-- src/node_device/node_device_driver.c | 3 +-- src/test/test_driver.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index 4c5ee8c..035a56d 100644 --- a/src/conf/virnodedeviceobj.c +++ b/src/conf/virnodedeviceobj.c @@ -545,8 +545,7 @@ virNodeDeviceObjListFindVportParentHost(virNodeDeviceOb= jListPtr devs) =20 int virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs, - virNodeDeviceDefPtr def, - int create) + virNodeDeviceDefPtr def) { int parent_host =3D -1; =20 @@ -561,7 +560,7 @@ virNodeDeviceObjListGetParentHost(virNodeDeviceObjListP= tr devs, parent_host =3D virNodeDeviceObjListGetParentHostByFabricWWN(devs, def->name, def->parent_fabri= c_wwn); - } else if (create =3D=3D CREATE_DEVICE) { + } else { /* Try to find a vport capable scsi_host when no parent supplied */ parent_host =3D virNodeDeviceObjListFindVportParentHost(devs); } diff --git a/src/conf/virnodedeviceobj.h b/src/conf/virnodedeviceobj.h index 788fb66..06f2e9e 100644 --- a/src/conf/virnodedeviceobj.h +++ b/src/conf/virnodedeviceobj.h @@ -75,8 +75,7 @@ virNodeDeviceObjListRemove(virNodeDeviceObjListPtr devs, =20 int virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs, - virNodeDeviceDefPtr def, - int create); + virNodeDeviceDefPtr def); =20 virNodeDeviceObjListPtr virNodeDeviceObjListNew(void); diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index f56ff34..920d877 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -563,8 +563,7 @@ nodeDeviceCreateXML(virConnectPtr conn, if (virNodeDeviceGetWWNs(def, &wwnn, &wwpn) =3D=3D -1) goto cleanup; =20 - if ((parent_host =3D virNodeDeviceObjListGetParentHost(driver->devs, d= ef, - CREATE_DEVICE)) <= 0) + if ((parent_host =3D virNodeDeviceObjListGetParentHost(driver->devs, d= ef)) < 0) goto cleanup; =20 if (virVHBAManageVport(parent_host, wwpn, wwnn, VPORT_CREATE) < 0) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 076b17a..bb2e7ba 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -5580,7 +5580,7 @@ testNodeDeviceCreateXML(virConnectPtr conn, /* Unlike the "real" code we don't need the parent_host in order to * call virVHBAManageVport, but still let's make sure the code finds * something valid and no one messed up the mock environment. */ - if (virNodeDeviceObjListGetParentHost(driver->devs, def, CREATE_DEVICE= ) < 0) + if (virNodeDeviceObjListGetParentHost(driver->devs, def) < 0) goto cleanup; =20 /* In the real code, we'd call virVHBAManageVport followed by --=20 2.9.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list