Skip to content

Commit

Permalink
ublksrv_tgt: avoid to dump lots of failure message in case that io_ur…
Browse files Browse the repository at this point in the history
…ing is disabled

Signed-off-by: Ming Lei <[email protected]>
  • Loading branch information
ming1 committed Dec 16, 2024
1 parent 46c08b0 commit 2e6bc2c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ublksrv_tgt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ static int list_one_dev(int number, bool log, bool verbose)

if (!dev) {
fprintf(stderr, "ublksrv_ctrl_init failed id %d\n", number);
return -errno;
return -ENODEV;
}
ret = ublksrv_ctrl_get_info(dev);
if (ret < 0) {
Expand Down Expand Up @@ -1030,8 +1030,12 @@ static int cmd_list_dev_info(int argc, char *argv[])
if (number >= 0)
return list_one_dev(number, true, verbose);

for (i = 0; i < MAX_NR_UBLK_DEVS; i++)
list_one_dev(i, false, verbose);
for (i = 0; i < MAX_NR_UBLK_DEVS; i++) {
int ret = list_one_dev(i, false, verbose);

if (ret == -ENODEV)
return ret;
}

return 0;
}
Expand Down

0 comments on commit 2e6bc2c

Please sign in to comment.