Commit 14032a98 authored by Gregory Shapiro's avatar Gregory Shapiro Committed by Ben Walker
Browse files

NVMF: Add model number as parameter to construct_nvmf_subsystem (-d option).

parent 68bb3995
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -88,6 +88,11 @@ is specified, use that specified nbd device. If it's not specified, pick availab
Add Opal scan support for NVMe to check whether it supports SED Opal and dump
device info. nvme_manage tool can be used to invoke this.

### nvmf

Add model number as parameter to construct_nvmf_subsystem (-d option),
rather than using hardcoded define.

## v19.01:

### ocf bdev
+3 −0
Original line number Diff line number Diff line
@@ -3562,6 +3562,7 @@ Example response:
      ],
      "allow_any_host": false,
      "serial_number": "abcdef",
      "model_number": "ghijklmnop",
      "namespaces": [
        {"nsid": 1, "name": "Malloc2"},
        {"nsid": 2, "name": "Nvme0n1"}
@@ -3581,6 +3582,7 @@ Name | Optional | Type | Description
----------------------- | -------- | ----------- | -----------
nqn                     | Required | string      | Subsystem NQN
serial_number           | Optional | string      | Serial number of virtual controller
model_number            | Optional | string      | Model number of virtual controller
max_namespaces          | Optional | number      | Maximum number of namespaces that can be attached to the subsystem. Default: 0 (Unlimited)
allow_any_host          | Optional | boolean     | Allow any host (`true`) or enforce allowed host whitelist (`false`). Default: `false`.

@@ -3597,6 +3599,7 @@ Example request:
    "nqn": "nqn.2016-06.io.spdk:cnode1",
    "allow_any_host": false,
    "serial_number": "abcdef",
    "model_number": "ghijklmnop"
  }
}
~~~
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ NQN, serial number, and IP address with RDMA transport to your own circumstances

~~~{.sh}
scripts/rpc.py construct_malloc_bdev -b Malloc0 512 512
scripts/rpc.py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001
scripts/rpc.py nvmf_subsystem_create nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001 -d SPDK_Controller1
scripts/rpc.py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 Malloc0
scripts/rpc.py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t rdma -a 192.168.100.8 -s 4420
~~~
+2 −0
Original line number Diff line number Diff line
@@ -226,6 +226,7 @@
  AllowAnyHost No
  Host nqn.2016-06.io.spdk:init
  SN SPDK00000000000001
  MN SPDK_Controller1
  MaxNamespaces 20
  Namespace Nvme0n1 1
  Namespace Nvme1n1 2
@@ -239,6 +240,7 @@
  AllowAnyHost No
  Host nqn.2016-06.io.spdk:init
  SN SPDK00000000000002
  MN SPDK_Controller2
  Namespace Malloc0
  Namespace Malloc1
  Namespace AIO0
+20 −0
Original line number Diff line number Diff line
@@ -672,6 +672,26 @@ const char *spdk_nvmf_subsystem_get_sn(const struct spdk_nvmf_subsystem *subsyst
 */
int spdk_nvmf_subsystem_set_sn(struct spdk_nvmf_subsystem *subsystem, const char *sn);

/**
 * Get the model number of the specified subsystem.
 *
 * \param subsystem Subsystem to query.
 *
 * \return model number of the specified subsystem.
 */
const char *spdk_nvmf_subsystem_get_mn(const struct spdk_nvmf_subsystem *subsystem);


/**
 * Set the model number for the specified subsystem.
 *
 * \param subsystem Subsystem to set for.
 * \param mn model number to set.
 *
 * \return 0 on success, -1 on failure.
 */
int spdk_nvmf_subsystem_set_mn(struct spdk_nvmf_subsystem *subsystem, const char *mn);

/**
 * Get the NQN of the specified subsystem.
 *
Loading