Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_zns_append()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_zns_mgmt_send() and nvme_zns_mgmt_recv()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Also convert zns.c to use nvme_zns_report_zones() instead of calling
nvme_zns_mgmt_recv() directly.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for NVMe reservation commands
Use an argument structure for NVMe reservation commands like
nvme_resv_acquire() or nvme_resv_release() instead of passing all
arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_copy()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_dsm()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for NVMe I/O commands
Use an argument structure for NVMe I/O commands like nvme_read() or
nvme_write() instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_virtual_mgmt()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_dev_self_test()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_sanize_nvm()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_set_property() and nvme_get_property()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_lockdown()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_capacity_mgmt()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_directive_send() and nvme_directive_receive()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_get_lba_status()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_security_send() and nvme_security_receive()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_fw_commit()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_fw_download()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_format_nvm() and nvme_ns_mgmt()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_identify()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_set_features() and nvme_get_features()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Also convert zns.c to use nvme_zns_report_zones() instead of calling
nvme_zns_mgmt_recv() directly.
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_get_log()
Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Daniel Wagner [Thu, 23 Dec 2021 13:59:01 +0000 (14:59 +0100)]
linux: Add support to generate DH-HMAC-CHAP keys
Initially the DH-HMAC-CHAP key generation code was part of the
nvme-cli repository and depended on OpenSSL 1. Move the key generation
code into the library. While at it also add support for OpenSSL 3.
Daniel Wagner [Mon, 27 Dec 2021 15:09:04 +0000 (16:09 +0100)]
build: Set C dialect and warning level
Currently, the Makefile is not setting the C dialect but the code was
carved out from the nvme-cli code base which relies on gnu99.
Let's define the C dialect to avoid any confusion and make the build
more consistent.
Without defining the default warning level the build system will use
the default level, which is implementation depended. For example muon
sets it to 3 which includes '-Wpendantic'. This results in a lot of
ISO-C non compliant warnings.
Let's define the warning level so that all build systems are using the
same values.
Daniel Wagner [Thu, 23 Dec 2021 15:38:04 +0000 (16:38 +0100)]
build: Avoid including wrong config.h as subpackage
In case the consuming project also uses a config.h we need to hide our
config.h file. By using the path to our config.h we avoid this
confusion. Obviously, 'src' is a bit too generic, thus move the
generated config.h under libnvme.
Introduce also a private include path because ccan has '#include
"config.h"' in its sources. So we need to present a config.h in the
lookup path but it needs to be the one from this project and not the
one from the consuming project.
Daniel Wagner [Wed, 22 Dec 2021 07:34:03 +0000 (08:34 +0100)]
util: Define inline function as static inline
The gcc in Centos 6.10 complains with
src/nvme/util.h:120: multiple definition of `nvme_feature_decode_arbitration'
'inline' alone does not guarantee that the function gets inlined. The
compiler is still free to decide, thus in this case it doesn't inline
and that's why we having multiple implementation with the same
name (in different compile units). 'static inline' forces the inline
which was the indent of this code.
Martin Belanger [Tue, 21 Dec 2021 20:36:38 +0000 (15:36 -0500)]
Replacing make by meson.
This involves replacing all Makefiles by meson.build files.
Also the top-level configure script now simply invokes meson.
The top-level Makefile is just a wrapper for meson. It supports
the following operations:
make
make test
make install
make clean # Remove build artifacts but keep configuration
make purge # Remove build artifacts and configuration
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Daniel Wagner [Tue, 21 Dec 2021 14:56:14 +0000 (15:56 +0100)]
fabrics: Declare loop index at the beginning of the block
The gcc in Centos 6.10 complains with
nvme/fabrics.c:909: error: ‘for’ loop initial declarations are only allowed in C99 mode
nvme/fabrics.c:909: note: use option -std=c99 or -std=gnu99 to compileyour code
Let's declare the index at the beginning of the basic block.
Daniel Wagner [Mon, 13 Dec 2021 17:37:21 +0000 (02:37 +0900)]
types: Add Controller Metadata and Namespace Metadata
Port and extent the libnvme part from the commit "Add NVMe MI
Features: Controller Metadata (0x7E) and Namespace Metadata (0x7F)."
from the nvme-cli monolithic branch.
While at it add the missing definitions and add some documentation.
This is based on Tokunori Ikegami first port attempt.
Tomas Bzatek [Wed, 1 Dec 2021 15:41:53 +0000 (16:41 +0100)]
types: Fabrics doc strings updates
Includes a typo correction, prefix changes, transition away from anonymous
enums and added some more enum members according to the standard.
All subtle API breaks.