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@redhat.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
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) {