Skip to content

Commit f100aa2

Browse files
tbzatekigaw
authored andcommitted
plugins/nbft: Use default library logging
Remove the workaround with creating empty root object and use the new libnvme API instead. Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
1 parent 46ea0d5 commit f100aa2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

plugins/nbft/nbft-plugin.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,6 @@ int show_nbft(int argc, char **argv, struct command *cmd, struct plugin *plugin)
535535
int ret;
536536
bool show_subsys = false, show_hfi = false, show_discovery = false;
537537
unsigned int verbose = 0;
538-
nvme_root_t r;
539538

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

554553
log_level = map_log_level(verbose, false /* quiet */);
554+
nvme_init_default_logging(stderr, log_level, false, false);
555555

556556
ret = validate_output_format(format, &flags);
557557
if (ret < 0)
558558
return ret;
559559

560-
/* initialize libnvme logging */
561-
r = nvme_create_root(stderr, log_level);
562-
563560
if (!(show_subsys || show_hfi || show_discovery))
564561
show_subsys = show_hfi = show_discovery = true;
565562

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

0 commit comments

Comments
 (0)