提交 d45bee44 编写于 作者: J John Ferlan

tools: Add support for additional adapter parent options

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: NJohn Ferlan <jferlan@redhat.com>
上级 8d2247df
...@@ -128,6 +128,18 @@ ...@@ -128,6 +128,18 @@
{.name = "adapter-parent", \ {.name = "adapter-parent", \
.type = VSH_OT_STRING, \ .type = VSH_OT_STRING, \
.help = N_("adapter parent scsi_hostN to be used for underlying vHBA storage") \ .help = N_("adapter parent scsi_hostN to be used for underlying vHBA storage") \
}, \
{.name = "adapter-parent-wwnn", \
.type = VSH_OT_STRING, \
.help = N_("adapter parent scsi_hostN wwnn to be used for underlying vHBA storage") \
}, \
{.name = "adapter-parent-wwpn", \
.type = VSH_OT_STRING, \
.help = N_("adapter parent scsi_hostN wwpn to be used for underlying vHBA storage") \
}, \
{.name = "adapter-parent-fabric-wwn", \
.type = VSH_OT_STRING, \
.help = N_("adapter parent scsi_hostN fabric_wwn to be used for underlying vHBA storage") \
} }
virStoragePoolPtr virStoragePoolPtr
...@@ -309,7 +321,9 @@ virshBuildPoolXML(vshControl *ctl, ...@@ -309,7 +321,9 @@ virshBuildPoolXML(vshControl *ctl,
*srcDev = NULL, *srcName = NULL, *srcFormat = NULL, *srcDev = NULL, *srcName = NULL, *srcFormat = NULL,
*target = NULL, *authType = NULL, *authUsername = NULL, *target = NULL, *authType = NULL, *authUsername = NULL,
*secretUsage = NULL, *adapterName = NULL, *adapterParent = NULL, *secretUsage = NULL, *adapterName = NULL, *adapterParent = NULL,
*adapterWwnn = NULL, *adapterWwpn = NULL, *secretUUID = NULL; *adapterWwnn = NULL, *adapterWwpn = NULL, *secretUUID = NULL,
*adapterParentWwnn = NULL, *adapterParentWwpn = NULL,
*adapterParentFabricWwn = NULL;
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
VSH_EXCLUSIVE_OPTIONS("secret-usage", "secret-uuid"); VSH_EXCLUSIVE_OPTIONS("secret-usage", "secret-uuid");
...@@ -332,7 +346,10 @@ virshBuildPoolXML(vshControl *ctl, ...@@ -332,7 +346,10 @@ virshBuildPoolXML(vshControl *ctl,
vshCommandOptStringReq(ctl, cmd, "adapter-name", &adapterName) < 0 || vshCommandOptStringReq(ctl, cmd, "adapter-name", &adapterName) < 0 ||
vshCommandOptStringReq(ctl, cmd, "adapter-wwnn", &adapterWwnn) < 0 || vshCommandOptStringReq(ctl, cmd, "adapter-wwnn", &adapterWwnn) < 0 ||
vshCommandOptStringReq(ctl, cmd, "adapter-wwpn", &adapterWwpn) < 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", &adapterParentWwnn) < 0 ||
vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwpn", &adapterParentWwpn) < 0 ||
vshCommandOptStringReq(ctl, cmd, "adapter-parent-fabric-wwn", &adapterParentFabricWwn) < 0)
goto cleanup; goto cleanup;
virBufferAsprintf(&buf, "<pool type='%s'>\n", type); virBufferAsprintf(&buf, "<pool type='%s'>\n", type);
...@@ -353,6 +370,12 @@ virshBuildPoolXML(vshControl *ctl, ...@@ -353,6 +370,12 @@ virshBuildPoolXML(vshControl *ctl,
virBufferAddLit(&buf, "<adapter type='fc_host'"); virBufferAddLit(&buf, "<adapter type='fc_host'");
if (adapterParent) if (adapterParent)
virBufferAsprintf(&buf, " parent='%s'", adapterParent); virBufferAsprintf(&buf, " parent='%s'", adapterParent);
else if (adapterParentWwnn && adapterParentWwpn)
virBufferAsprintf(&buf, " parent_wwnn='%s' parent_wwnn='%s'",
adapterParentWwnn, adapterParentWwpn);
else if (adapterParentFabricWwn)
virBufferAsprintf(&buf, " parent_fabric_wwn='%s'",
adapterParentFabricWwn);
virBufferAsprintf(&buf, " wwnn='%s' wwpn='%s'/>\n", virBufferAsprintf(&buf, " wwnn='%s' wwpn='%s'/>\n",
adapterWwnn, adapterWwpn); adapterWwnn, adapterWwpn);
} else if (adapterName) { } else if (adapterName) {
......
...@@ -3768,10 +3768,17 @@ be provided, but not both. ...@@ -3768,10 +3768,17 @@ be provided, but not both.
[I<--adapter-name name>] defines the scsi_hostN adapter name to be used for [I<--adapter-name name>] defines the scsi_hostN adapter name to be used for
the scsi_host adapter type pool. the scsi_host adapter type pool.
[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<adapter-parent-wwpn parent_wwpn> |
I<--adapter-parent-fabric-wwn parent_fabric_wwn>]]
defines the wwnn and wwpn to be used for the fc_host adapter type pool. 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 Optionally provide the parent scsi_hostN node device to be used for the
be used for the vHBA. 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.
[I<--build>] [[I<--overwrite>] | [I<--no-overwrite>]] perform a [I<--build>] [[I<--overwrite>] | [I<--no-overwrite>]] perform a
B<pool-build> after creation in order to remove the need for a B<pool-build> after creation in order to remove the need for a
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册