]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Display NVMe command status in both string and hex format for write_uncorr and write_...
authorroot <slw26c@gmail.com>
Wed, 6 Jul 2016 16:58:01 +0000 (09:58 -0700)
committerroot <slw26c@gmail.com>
Wed, 6 Jul 2016 16:58:01 +0000 (09:58 -0700)
nvme.c

diff --git a/nvme.c b/nvme.c
index 2bd194c4d54f3ca8b9a38c3515a8430c3f3f6245..3e1b3d60e663ea6360fdd73e5c7e3d374b8f07c3 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -1639,7 +1639,8 @@ static int write_uncor(int argc, char **argv, struct command *cmd, struct plugin
        if (err < 0)
                return errno;
        else if (err != 0)
-               fprintf(stderr, "NVME Write Uncorrectable Command Error:%d\n", err);
+               fprintf(stderr, "NVME IO command error:%s(%x)\n",
+                                       nvme_status_to_string(err), err);
        else
                printf("NVME Write Uncorrectable Success\n");
        return err;
@@ -1713,7 +1714,8 @@ static int write_zeroes(int argc, char **argv, struct command *cmd, struct plugi
        if (err < 0)
                return errno;
        else if (err != 0)
-               fprintf(stderr, "NVME Write Zeroes Command Error:%d\n", err);
+               fprintf(stderr, "NVME IO command error:%s(%x)\n",
+                                       nvme_status_to_string(err), err);
        else
                printf("NVME Write Zeroes Success\n");
        return err;