From nobody Wed May 14 15:29:22 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520551962146243.46545383215062; Thu, 8 Mar 2018 15:32:42 -0800 (PST) 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 03F3881DE1; Thu, 8 Mar 2018 23:32:40 +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 BA3395D760; Thu, 8 Mar 2018 23:32:37 +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 B9443181B9FC; Thu, 8 Mar 2018 23:32:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w28NVRNF018983 for ; Thu, 8 Mar 2018 18:31:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id E01B57652E; Thu, 8 Mar 2018 23:31:27 +0000 (UTC) Received: from unknown54ee7586bd10.attlocal.net.com (ovpn-116-138.phx2.redhat.com [10.3.116.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id A06637CA57 for ; Thu, 8 Mar 2018 23:31:27 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Thu, 8 Mar 2018 18:31:20 -0500 Message-Id: <20180308233120.22170-4-jferlan@redhat.com> In-Reply-To: <20180308233120.22170-1-jferlan@redhat.com> References: <20180308233120.22170-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] tools: Add support for additional adapter parent options 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, 08 Mar 2018 23:32:41 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add the ability to provide the adapter parent_wwnn and parent_wwpn or the parent_fabric_wwn on the virsh command line for the pool define/create as commands. Update the virsh.pod description. Signed-off-by: John Ferlan --- tools/virsh-pool.c | 27 +++++++++++++++++++++++++-- tools/virsh.pod | 13 ++++++++++--- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 668e8087d..36bf8d9fa 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -128,6 +128,18 @@ {.name =3D "adapter-parent", \ .type =3D VSH_OT_STRING, \ .help =3D N_("adapter parent scsi_hostN to be used for underlying vHB= A storage") \ + }, \ + {.name =3D "adapter-parent-wwnn", \ + .type =3D VSH_OT_STRING, \ + .help =3D N_("adapter parent scsi_hostN wwnn to be used for underlyin= g vHBA storage") \ + }, \ + {.name =3D "adapter-parent-wwpn", \ + .type =3D VSH_OT_STRING, \ + .help =3D N_("adapter parent scsi_hostN wwpn to be used for underlyin= g vHBA storage") \ + }, \ + {.name =3D "adapter-parent-fabric-wwn", \ + .type =3D VSH_OT_STRING, \ + .help =3D N_("adapter parent scsi_hostN fabric_wwn to be used for und= erlying vHBA storage") \ } =20 virStoragePoolPtr @@ -309,7 +321,9 @@ virshBuildPoolXML(vshControl *ctl, *srcDev =3D NULL, *srcName =3D NULL, *srcFormat =3D NULL, *target =3D NULL, *authType =3D NULL, *authUsername =3D NUL= L, *secretUsage =3D NULL, *adapterName =3D NULL, *adapterParen= t =3D NULL, - *adapterWwnn =3D NULL, *adapterWwpn =3D NULL, *secretUUID = =3D NULL; + *adapterWwnn =3D NULL, *adapterWwpn =3D NULL, *secretUUID = =3D NULL, + *adapterParentWwnn =3D NULL, *adapterParentWwpn =3D NULL, + *adapterParentFabricWwn =3D NULL; virBuffer buf =3D VIR_BUFFER_INITIALIZER; =20 VSH_EXCLUSIVE_OPTIONS("secret-usage", "secret-uuid"); @@ -332,7 +346,10 @@ virshBuildPoolXML(vshControl *ctl, vshCommandOptStringReq(ctl, cmd, "adapter-name", &adapterName) < 0= || vshCommandOptStringReq(ctl, cmd, "adapter-wwnn", &adapterWwnn) < 0= || vshCommandOptStringReq(ctl, cmd, "adapter-wwpn", &adapterWwpn) < 0= || - vshCommandOptStringReq(ctl, cmd, "adapter-parent", &adapterParent)= < 0) + vshCommandOptStringReq(ctl, cmd, "adapter-parent", &adapterParent)= < 0 || + vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwnn", &adapterPa= rentWwnn) < 0 || + vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwpn", &adapterPa= rentWwpn) < 0 || + vshCommandOptStringReq(ctl, cmd, "adapter-parent-fabric-wwn", &ada= pterParentFabricWwn) < 0) goto cleanup; =20 virBufferAsprintf(&buf, "\n", type); @@ -353,6 +370,12 @@ virshBuildPoolXML(vshControl *ctl, virBufferAddLit(&buf, "\n", adapterWwnn, adapterWwpn); } else if (adapterName) { diff --git a/tools/virsh.pod b/tools/virsh.pod index 9fa483da3..20236885e 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -3768,10 +3768,17 @@ be provided, but not both. [I<--adapter-name name>] defines the scsi_hostN adapter name to be used for the scsi_host adapter type pool. =20 -[I<--adapter-wwnn wwnn> I<--adapter-wwpn wwpn> [I<--adapter-parent parent>= ]] +[I<--adapter-wwnn wwnn> I<--adapter-wwpn wwpn> [I<--adapter-parent parent>= | +I<--adapter-parent-wwnn parent_wwnn> I | +I<--adapter-parent-fabric-wwn parent_fabric_wwn>]] defines the wwnn and wwpn to be used for the fc_host adapter type pool. -The parent optionally provides the name of the scsi_hostN node device to -be used for the vHBA. +Optionally provide the parent scsi_hostN node device to be used for the +vHBA either by parent name, parent_wwnn and parent_wwpn, or parent_fabric_= wwn. +The parent name could change between reboots if the hardware environment +changes, so providing the parent_wwnn and parent_wwpn ensure usage of the +same physical HBA even if the scsi_hostN node device changes. Usage of the +parent_fabric_wwn allows a bit more flexibility to choose an HBA on the +same storage fabric in order to define the pool. =20 [I<--build>] [[I<--overwrite>] | [I<--no-overwrite>]] perform a B after creation in order to remove the need for a --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list