rpc: reconcile options for construct_nvme_bdev

Change-Id: I7a13559312979f5019b42305ebe02ec102dda2a1
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/437574
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Seth Howell 2018-12-18 16:49:15 -07:00 committed by Jim Harris
parent 088379cf74
commit cc7a099c0c
2 changed files with 7 additions and 1 deletions

View File

@ -252,6 +252,7 @@ if __name__ == "__main__":
adrfam=args.adrfam,
trsvcid=args.trsvcid,
subnqn=args.subnqn,
hostnqn=args.hostnqn,
hostaddr=args.hostaddr,
hostsvcid=args.hostsvcid))
@ -267,6 +268,7 @@ if __name__ == "__main__":
p.add_argument('-s', '--trsvcid',
help='NVMe-oF target trsvcid: e.g., a port number')
p.add_argument('-n', '--subnqn', help='NVMe-oF target subnqn')
p.add_argument('-q', '--hostnqn', help='NVMe-oF host subnqn')
p.add_argument('-i', '--hostaddr',
help='NVMe-oF host address: e.g., an ip address')
p.add_argument('-c', '--hostsvcid',

View File

@ -215,7 +215,7 @@ def set_bdev_nvme_hotplug(client, enable, period_us=None):
return client.call('set_bdev_nvme_hotplug', params)
def construct_nvme_bdev(client, name, trtype, traddr, adrfam=None, trsvcid=None, subnqn=None, hostaddr=None, hostsvcid=None):
def construct_nvme_bdev(client, name, trtype, traddr, adrfam=None, trsvcid=None, subnqn=None, hostnqn=None, hostaddr=None, hostsvcid=None):
"""Construct NVMe namespace block devices.
Args:
@ -225,6 +225,7 @@ def construct_nvme_bdev(client, name, trtype, traddr, adrfam=None, trsvcid=None,
adrfam: address family ("IPv4", "IPv6", "IB", or "FC") (optional for PCIe)
trsvcid: transport service ID (port number for IP-based addresses; optional for PCIe)
subnqn: subsystem NQN to connect to (optional)
hostnqn: NQN to connect from (optional)
hostaddr: host transport address (IP address for IP-based transports, NULL for PCIe or FC; optional)
hostsvcid: host transport service ID (port number for IP-based transports, NULL for PCIe or FC; optional)
@ -235,6 +236,9 @@ def construct_nvme_bdev(client, name, trtype, traddr, adrfam=None, trsvcid=None,
'trtype': trtype,
'traddr': traddr}
if hostnqn:
params['hostnqn'] = hostnqn
if hostaddr:
params['hostaddr'] = hostaddr