Skip to content

Commit 08e71e9

Browse files
committed
fabrics: make 'disconnect' accepting only -n or -d
There is limited usability in specifying both -n and -d, so make both exclusive. Signed-off-by: Hannes Reinecke <[email protected]>
1 parent 2247a5d commit 08e71e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fabrics.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,11 @@ int nvmf_disconnect(const char *desc, int argc, char **argv)
11891189
if (ret)
11901190
return ret;
11911191

1192+
if (cfg.nqn && cfg.device) {
1193+
fprintf(stderr,
1194+
"Both device name [--device | -d] and NQN [--nqn | -n] are specified\n);
1195+
return -EINVAL;
1196+
}
11921197
if (!cfg.nqn && !cfg.device) {
11931198
fprintf(stderr,
11941199
"Neither device name [--device | -d] nor NQN [--nqn | -n] provided\n");

0 commit comments

Comments
 (0)