Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nvme-print.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,14 @@ void nvme_show_status(int status)
ops->show_status(status);
}

void nvme_show_err(const char *msg, int err)
{
if (err < 0)
nvme_show_error("%s: %s", msg, nvme_strerror(-err));
else if (err > 0)
nvme_show_status(err);
}

void nvme_show_opcode_status(int status, bool admin, __u8 opcode)
{
struct print_ops *ops = nvme_print_ops(NORMAL);
Expand Down
1 change: 1 addition & 0 deletions nvme-print.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ struct print_ops *nvme_get_stdout_print_ops(nvme_print_flags_t flags);
struct print_ops *nvme_get_binary_print_ops(nvme_print_flags_t flags);

void nvme_show_status(int status);
void nvme_show_err(const char *msg, int err);
void nvme_show_opcode_status(int status, bool admin, __u8 opcode);
void nvme_show_lba_status_info(__u64 result);
void nvme_show_relatives(struct nvme_global_ctx *ctx, const char *name, nvme_print_flags_t flags);
Expand Down
Loading