Skip to content

Commit

Permalink
plugins/nbft: Use default library logging
Browse files Browse the repository at this point in the history
Remove the workaround with creating empty root
object and use the new libnvme API instead.

Signed-off-by: Tomas Bzatek <[email protected]>
  • Loading branch information
tbzatek authored and igaw committed May 14, 2024
1 parent 46ea0d5 commit f100aa2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions plugins/nbft/nbft-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin)
int ret;
bool show_subsys = false, show_hfi = false, show_discovery = false;
unsigned int verbose = 0;
nvme_root_t r;

OPT_ARGS(opts) = {
OPT_FMT("output-format", 'o', &format, "Output format: normal|json"),
Expand All @@ -552,14 +551,12 @@ int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin)
return ret;

log_level = map_log_level(verbose, false /* quiet */);
nvme_init_default_logging(stderr, log_level, false, false);

ret = validate_output_format(format, &flags);
if (ret < 0)
return ret;

/* initialize libnvme logging */
r = nvme_create_root(stderr, log_level);

if (!(show_subsys || show_hfi || show_discovery))
show_subsys = show_hfi = show_discovery = true;

Expand All @@ -572,6 +569,5 @@ int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin)
ret = json_show_nbfts(&nbft_list, show_subsys, show_hfi, show_discovery);
free_nbfts(&nbft_list);
}
nvme_free_tree(r);
return ret;
}

0 comments on commit f100aa2

Please sign in to comment.