libmultipath: ANA prioritzer: use nvme wrapper library
authorMartin Wilck <mwilck@suse.com>
Sun, 23 Dec 2018 22:21:21 +0000 (23:21 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 7 Jan 2019 10:46:38 +0000 (11:46 +0100)
commitc5616efde85d77aaaf574932ac2c4c2dd86a3bda
treeb97010052099bc10d6bd9def33dcf61c984e6f01
parentdaf9d587bca7fdca5b4bd72e8560442a335c6639
libmultipath: ANA prioritzer: use nvme wrapper library

Use the previously introduced NVME wrapper library for
the passthrough commands from the ANA prioritizer. Discard
code duplicated from nvme-cli from the ana code itself.

Furthermore, make additional cleanups in the ANA prioritizer:

 - don't use the same enum for priorities and error codes
 - use char* arrays for error messages and state names
 - return -1 prio to libmultipath for all error cases
 - check for overflow in check_ana_state()
 - get_ana_info(): improve readability with is_anagrpid_const
 - priorities: PERSISTENT_LOSS state is worse than INACCESSIBLE
 and CHANGE

Cc: lijie <lijie34@huawei.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/prioritizers/Makefile
libmultipath/prioritizers/ana.c
libmultipath/prioritizers/ana.h [deleted file]