]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme-status: Introduce nvme status module to map errno
authorMinwoo Im <minwoo.im.dev@gmail.com>
Tue, 21 May 2019 16:36:57 +0000 (01:36 +0900)
committerMinwoo Im <minwoo.im.dev@gmail.com>
Thu, 20 Jun 2019 14:23:12 +0000 (23:23 +0900)
commitd1f49c7cf445edf0bd91e6f444cddc05b765914a
tree2cbb45dccb64fd009a6783b92b9ba8ffb6daeebd
parent8a50442a034ce9a4529300737ed7b674e766a7ec
nvme-status: Introduce nvme status module to map errno

Background:
  It's not enough to return the nvme status value in main() because it's
allowed to be in 8bits, but nvme status is indicated in 16bits.  So we
has not been able to figure out what kind of nvme status has been
returned by return value.

  This patch introduces nvme-status module that manages mapping between
nvme status and errno.  It's not possible to make 1:1 mapping relations,
but we can map it as a groups.

All the internal errors which has been returned in a negative value will
be returned with ECOMM that indicates communication errors.  In this
case, we can see what happened via stderr.

Cc: Keith Busch <kbusch@kernel.org>
Cc: Chaitanya Kulkarni <chaitanya.Kulkarni@wdc.com>
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Makefile
linux/nvme.h
nvme-status.c [new file with mode: 0644]
nvme-status.h [new file with mode: 0644]