.type = VSH_OT_STRING,
.help = N_("auth secret usage to be used for underlying storage")
},
+ {.name = "adapter-name",
+ .type = VSH_OT_STRING,
+ .help = N_("adapter name to be used for underlying storage")
+ },
+ {.name = "adapter-wwnn",
+ .type = VSH_OT_STRING,
+ .help = N_("adapter wwnn to be used for underlying storage")
+ },
+ {.name = "adapter-wwpn",
+ .type = VSH_OT_STRING,
+ .help = N_("adapter wwpn to be used for underlying storage")
+ },
+ {.name = "adapter-parent",
+ .type = VSH_OT_STRING,
+ .help = N_("adapter parent to be used for underlying storage")
+ },
{.name = NULL}
};
const char *name = NULL, *type = NULL, *srcHost = NULL, *srcPath = NULL,
*srcDev = NULL, *srcName = NULL, *srcFormat = NULL,
*target = NULL, *authType = NULL, *authUsername = NULL,
- *secretUsage = NULL;
+ *secretUsage = NULL, *adapterName = NULL, *adapterParent = NULL,
+ *adapterWwnn = NULL, *adapterWwpn = NULL;
virBuffer buf = VIR_BUFFER_INITIALIZER;
if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
vshCommandOptStringReq(ctl, cmd, "target", &target) < 0 ||
vshCommandOptStringReq(ctl, cmd, "auth-type", &authType) < 0 ||
vshCommandOptStringReq(ctl, cmd, "auth-username", &authUsername) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "secret-usage", &secretUsage) < 0)
+ vshCommandOptStringReq(ctl, cmd, "secret-usage", &secretUsage) < 0 ||
+ 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)
goto cleanup;
virBufferAsprintf(&buf, "<pool type='%s'>\n", type);
virBufferAsprintf(&buf, "<dir path='%s'/>\n", srcPath);
if (srcDev)
virBufferAsprintf(&buf, "<device path='%s'/>\n", srcDev);
+ if (adapterWwnn && adapterWwpn) {
+ virBufferAddLit(&buf, "<adapter type='fc_host'");
+ if (adapterParent)
+ virBufferAsprintf(&buf, " parent='%s'", adapterParent);
+ virBufferAsprintf(&buf, " wwnn='%s' wwpn='%s'/>\n",
+ adapterWwnn, adapterWwpn);
+ } else if (adapterName) {
+ virBufferAsprintf(&buf, "<adapter type='scsi_host' name='%s'/>\n",
+ adapterName);
+ }
if (authType && authUsername && secretUsage) {
virBufferAsprintf(&buf, "<auth type='%s' username='%s'>\n",
authType, authUsername);
[I<--source-host hostname>] [I<--source-path path>] [I<--source-dev path>]
[I<--source-name name>] [I<--target path>] [I<--source-format format>]
[I<--auth-type authtype> I<--auth-username username> I<--secret-usage usage>]
+[[I<--adapter-name name>] | [I<--adapter-wwnn> I<--adapter-wwpn>]
+[I<--adapter-parent parent>]]
+
Create and start a pool object I<name> from the raw parameters. If
I<--print-xml> is specified, then print the XML of the pool object
the storage pool. The I<authtype> is either chap for iscsi I<type> pools or
ceph for rbd I<type> pools.
+[I<--adapter-name name>] defines the scsi_hostN adapter name to be used for
+the scsi_host adapter type pool.
+
+[I<--adapter-wwnn> I<--adapter-wwpn> [I<--adapter-parent parent>]] 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.
+
=item B<pool-define> I<file>
Create, but do not start, a pool object from the XML I<file>.
[I<--source-host hostname>] [I<--source-path path>] [I<--source-dev path>]
[I<--source-name name>] [I<--target path>] [I<--source-format format>]
[I<--auth-type authtype> I<--auth-username username> I<--secret-usage usage>]
+[[I<--adapter-name name>] | [I<--adapter-wwnn> I<--adapter-wwpn>]
+[I<--adapter-parent parent>]]
Create, but do not start, a pool object I<name> from the raw parameters. If
I<--print-xml> is specified, then print the XML of the pool object