diff --git a/app/nvmf_tgt/conf.c b/app/nvmf_tgt/conf.c index 7889b617d..a19948299 100644 --- a/app/nvmf_tgt/conf.c +++ b/app/nvmf_tgt/conf.c @@ -730,12 +730,7 @@ spdk_nvmf_parse_subsystem_for_rpc(const char *name, /* Parse Host sections */ for (i = 0; i < num_hosts; i++) { - char *host_nqn; - - host_nqn = hosts[i]; - if (strcmp(host_nqn, "All") == 0) - break; - spdk_nvmf_subsystem_add_host(subsystem, host_nqn); + spdk_nvmf_subsystem_add_host(subsystem, hosts[i]); } if (subsystem->mode == NVMF_SUBSYSTEM_MODE_DIRECT) { diff --git a/app/nvmf_tgt/nvmf_rpc.c b/app/nvmf_tgt/nvmf_rpc.c index 6026a9bd2..6c4ce217a 100644 --- a/app/nvmf_tgt/nvmf_rpc.c +++ b/app/nvmf_tgt/nvmf_rpc.c @@ -283,7 +283,7 @@ static const struct spdk_json_object_decoder rpc_subsystem_decoders[] = { {"mode", offsetof(struct rpc_subsystem, mode), spdk_json_decode_string}, {"nqn", offsetof(struct rpc_subsystem, nqn), spdk_json_decode_string}, {"listen_addresses", offsetof(struct rpc_subsystem, listen_addresses), decode_rpc_listen_addresses}, - {"hosts", offsetof(struct rpc_subsystem, hosts), decode_rpc_hosts}, + {"hosts", offsetof(struct rpc_subsystem, hosts), decode_rpc_hosts, true}, {"pci_address", offsetof(struct rpc_subsystem, pci_address), spdk_json_decode_string, true}, {"serial_number", offsetof(struct rpc_subsystem, serial_number), spdk_json_decode_string, true}, {"namespaces", offsetof(struct rpc_subsystem, namespaces), decode_rpc_dev_names, true}, diff --git a/scripts/rpc.py b/scripts/rpc.py index 8c64bed58..b334ea86e 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -309,23 +309,23 @@ p = subparsers.add_parser('get_nvmf_subsystems', help='Display nvmf subsystems') p.set_defaults(func=get_nvmf_subsystems) def construct_nvmf_subsystem(args): - hosts = [] - listen_addresses = [dict(u.split(":") for u in a.split(" ")) for a in args.listen.split(",")] - for u in args.hosts.split(" "): - hosts.append(u) - params = { 'core': args.core, 'mode': args.mode, 'nqn': args.nqn, 'listen_addresses': listen_addresses, - 'hosts': hosts, 'pci_address': args.pci_address, 'serial_number': args.serial_number, } + if args.hosts: + hosts = [] + for u in args.hosts.split(" "): + hosts.append(u) + params['hosts'] = hosts + if args.namespaces: namespaces = [] for u in args.namespaces.split(" "): diff --git a/test/nvmf/discovery/discovery.sh b/test/nvmf/discovery/discovery.sh index 6c83c43e3..d21c1b785 100755 --- a/test/nvmf/discovery/discovery.sh +++ b/test/nvmf/discovery/discovery.sh @@ -35,8 +35,8 @@ if [ -e "/dev/nvme-fabrics" ]; then chmod a+rw /dev/nvme-fabrics fi -$rpc_py construct_nvmf_subsystem Direct nqn.2016-06.io.spdk:cnode1 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' All -p "*" -$rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode2 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' All -s SPDK00000000000001 -n 'Malloc0 Malloc1' +$rpc_py construct_nvmf_subsystem Direct nqn.2016-06.io.spdk:cnode1 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -p "*" +$rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode2 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -s SPDK00000000000001 -n 'Malloc0 Malloc1' nvme discover -t rdma -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT diff --git a/test/nvmf/filesystem/filesystem.sh b/test/nvmf/filesystem/filesystem.sh index 9d6fa0286..9b13bcbe2 100755 --- a/test/nvmf/filesystem/filesystem.sh +++ b/test/nvmf/filesystem/filesystem.sh @@ -30,8 +30,8 @@ if [ -e "/dev/nvme-fabrics" ]; then chmod a+rw /dev/nvme-fabrics fi -$rpc_py construct_nvmf_subsystem Direct nqn.2016-06.io.spdk:cnode1 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' All -p "*" -$rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode2 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' All -s SPDK00000000000001 -n 'Malloc0 Malloc1' +$rpc_py construct_nvmf_subsystem Direct nqn.2016-06.io.spdk:cnode1 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -p "*" +$rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode2 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -s SPDK00000000000001 -n 'Malloc0 Malloc1' nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode2" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" diff --git a/test/nvmf/fio/fio.sh b/test/nvmf/fio/fio.sh index b7b004cff..99169b158 100755 --- a/test/nvmf/fio/fio.sh +++ b/test/nvmf/fio/fio.sh @@ -30,8 +30,8 @@ if [ -e "/dev/nvme-fabrics" ]; then chmod a+rw /dev/nvme-fabrics fi -$rpc_py construct_nvmf_subsystem Direct nqn.2016-06.io.spdk:cnode1 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' All -p "*" -$rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode2 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' All -s SPDK00000000000001 -n 'Malloc0 Malloc1' +$rpc_py construct_nvmf_subsystem Direct nqn.2016-06.io.spdk:cnode1 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -p "*" +$rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode2 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -s SPDK00000000000001 -n 'Malloc0 Malloc1' nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode2" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" diff --git a/test/nvmf/nvme_cli/nvme_cli.sh b/test/nvmf/nvme_cli/nvme_cli.sh index 9cc8dc2d1..7f0d602a7 100755 --- a/test/nvmf/nvme_cli/nvme_cli.sh +++ b/test/nvmf/nvme_cli/nvme_cli.sh @@ -29,8 +29,8 @@ if [ -e "/dev/nvme-fabrics" ]; then chmod a+rw /dev/nvme-fabrics fi -$rpc_py construct_nvmf_subsystem Direct nqn.2016-06.io.spdk:cnode1 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' All -p "*" -$rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode2 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' All -s SPDK00000000000001 -n 'Malloc0 Malloc1' +$rpc_py construct_nvmf_subsystem Direct nqn.2016-06.io.spdk:cnode1 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -p "*" +$rpc_py construct_nvmf_subsystem Virtual nqn.2016-06.io.spdk:cnode2 'transport:RDMA traddr:192.168.100.8 trsvcid:4420' '' -s SPDK00000000000001 -n 'Malloc0 Malloc1' nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode1" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT" nvme connect -t rdma -n "nqn.2016-06.io.spdk:cnode2" -a "$NVMF_FIRST_TARGET_IP" -s "$NVMF_PORT"