nvme-cli: return 0 if disconnect operation with cfg.nqn successfully
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
@@ -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
Keith Busch
AppliedPATCH 1/1 nvme-cli: return 0 if disconnect operation with cfg.nqn successfully
Quoted 3 lines · Yi Zhang
disconnect_by_nqnfunction will return the number of controllers successfully disconnected, so change ret = 0 if disconnect operation with nqn successfully.
Thanks, applied.
Sagi Grimberg
maintainerPATCH 1/1 nvme-cli: return 0 if disconnect operation with cfg.nqn successfully
In reply to Yi ZhangReviewed-by Sagi Grimberg <sagi at grimberg.me>