Skip to contentSkip to conversation

nvme-cli: return 0 if disconnect operation with cfg.nqn successfully

PATCH New Yi Zhang 3 participants 3 messages Apr 18, 2017 – Apr 20, 2017 NVMe

lore
Share & tools
lore

Yi Zhang

author
#0 lore raw

PATCH 1/1 nvme-cli: return 0 if disconnect operation with cfg.nqn successfully

disconnect_by_nqn function will return the number of controllers successfully disconnected, so change ret = 0 if disconnect operation with nqn successfully.

$ ./nvme disconnect -n testnqn
NQN:testnqn disconnected 1 controller(s)
$ echo $?
1
Signed-off-by Yi Zhang <yizhan at redhat.com>
---
 fabrics.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fabrics.c +3 -1
index cd671c7..a2e8f60 100644
@@ -934,8 +934,10 @@ int disconnect(const char *desc, int argc, char **argv)
 		if (ret < 0)
 			fprintf(stderr, "Failed to disconnect by NQN: %s\n",
 				cfg.nqn);
-		else
+		else {
 			printf("NQN:%s disconnected %d controller(s)\n", cfg.nqn, ret);
+			ret = 0;
+		}
 	}
 
 	if (cfg.device) {
Signature · 1 line
2.9.3
Applied
#1 lore raw

PATCH 1/1 nvme-cli: return 0 if disconnect operation with cfg.nqn successfully

Quoted 3 lines · Yi Zhang

disconnect_by_nqn function will return the number of controllers successfully disconnected, so change ret = 0 if disconnect operation with nqn successfully.

Thanks, applied.