From 64707b1e33a389dc894c97a2d12cf01e92d856fa Mon Sep 17 00:00:00 2001 From: "Blachut, Bartosz" Date: Tue, 28 Sep 2021 09:59:24 +0200 Subject: [PATCH] rpc: fix removing a listener with an empty trsvcid If trsvcid is not set in the nvmf_subsystem_remove_listener call, rpc client treats it as 'None' and sends "null" to the application, which causes decode failure in SPDK. Trsvcid is described as optional and should be treated this way. For such a listener removal call with an empty trsvcid, "" should be sent as trsvcid instead of "null" in the json request. Signed-off-by: Blachut, Bartosz Change-Id: Ic26907c22a2600c9618354ce8ff63e93e00aec09 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9659 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jacek Kalwas Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris --- scripts/rpc/nvmf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/rpc/nvmf.py b/scripts/rpc/nvmf.py index 915c04b4b..ca49fdc35 100644 --- a/scripts/rpc/nvmf.py +++ b/scripts/rpc/nvmf.py @@ -291,8 +291,10 @@ def nvmf_subsystem_remove_listener( True or False """ listen_address = {'trtype': trtype, - 'traddr': traddr, - 'trsvcid': trsvcid} + 'traddr': traddr} + + if trsvcid: + listen_address['trsvcid'] = trsvcid if adrfam: listen_address['adrfam'] = adrfam