Steven Seungcheol Lee [Mon, 2 Aug 2021 07:00:35 +0000 (16:00 +0900)]
Bug fix unsigned int and int should use 64bit api for json-c
unsigned int should use json_object_new_uint64(json-c >= 0.14-20200419)
Error examples
nsze : 0xe8e088b0
{
"nsze":-387938128
}
After fix this
{
"nsze":3907029168
}
json_object_add_value_int also should use json_object_new_int64
since util/json.h support long long type, and other codes are using it for 64bit values
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: removed nvme-ioctl.c changes, part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Daniel Wagner [Fri, 23 Jul 2021 10:32:15 +0000 (12:32 +0200)]
gen-hostnqn: Remove UUID validation heuristic
The validation heuristic is getting triggered for valid system UUID
such as 37383638-3330-4d32-3237-33353032394e. The only UUID validation
is already implemented. Remove the heuristic as it blocks valid use
UUIDs and doesn't protect from misuse anyway.
Michael Gebis [Tue, 20 Jul 2021 01:03:56 +0000 (18:03 -0700)]
Bash completions
Added support for latest commands
Added support for latest plugins
[dwagner: updated resv-report command] Signed-off-by: Daniel Wagner <dwagner@suse.de>
nvme: add multiple update detected result value in fw commit
Add Multiple Update Detected (MUD) field in FW Commit command
CQE CDW0 as per NVMe 2.0 Spec.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: removed nvme-ioctl changes; part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
fix boot partitions register show in human readable format
If BPINFO or BPRSEL or BPMBL are zero means it doesn't indicates
that boot parttitions feature is not supported. CAP registers BPS
bit indicatates this feature support, fix that.
Change the IOCTL and depricate SQE structure for NVM commands
Read, Write and Compare Commands to add support for the Storage
Tag field (CDW2 and CDW3).
Remove the unsed nvme_user_io structure and NVME_IOCTL_SUBMIT_IO.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: removed nvme-ioctl changes, part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
nvme: add CDW2 and CDW3 support for Write Zeroes and Verify Command
Added support for the Variable Sized Expected Logical Block Storage Tag(ELBST)
and Expected Logical Block Reference Tag (ELBRT), CDW2 and CDW3 (00:47) bits
for NVM commands Write Zeroes and Verify commands.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: removed nvme-ioctl.c changes, these are part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
fixthething [Sat, 6 Mar 2021 16:56:41 +0000 (11:56 -0500)]
Doing dword alignment whether source of misalignment comes from file size or specified transfer length. Zeroing buffer to ensure zero fill and no heap garbage.
Daniel Wagner [Mon, 8 Nov 2021 09:42:02 +0000 (10:42 +0100)]
build: Use CONFIG_JSONC consistently
The config flag for json-c hasn't been updated to the consistent
naming scheme everywhere. Let's use prefix it with CONFIG and use the
correct library name which is json-c.
Daniel Wagner [Tue, 2 Nov 2021 12:42:45 +0000 (13:42 +0100)]
workflow: Disable tests for libnvme
The testsuite for nvme-cli is already disable because they are not
ready to be used in our CI setup. The same seems to be the case for
libnvme. The Python tests are failing at this point. Let's disable
them until we figured out how to enable them safely for CI.
Daniel Wagner [Tue, 2 Nov 2021 12:32:47 +0000 (13:32 +0100)]
build: Prefix configuration switches
Although we decided to depend hard on json-c and libuuid, we still are
able to build and link without those libraries. Let's keep this
working for a little while longer before we pull the plug.
Daniel Wagner [Mon, 18 Oct 2021 15:40:18 +0000 (17:40 +0200)]
build: Set minimum version for json-c and add fallback support
Set minimum version for json-c to 0.13.
nvme-cli uses json_util_get_last_err() which got introduced in 0.13,
released in December 2017.
Also, meson supports embedded library build. This is very handy for
system which ship outdated an really outdated json-c library.
The include path for json.h has to be adapted. The json-c upstream
project is not clear which include prefix should be used ('#include
<json-c/json.h>" vs '#include <json.h>'. In order to support embedded
builds, we need to use the second version of the include. The source
code is added to the build, hence we use the include directory path of
the project layout. And json-c has all include files in the root
directory. This is no problem when using a installed version of json-c
as pkg-config adds '-I/usr/inlude/json-c' to the include paths:
$pkg-config --cflags json-c
-I/usr/include/json-c
So the simplest thing to support both build cased (external/embedded)
just drop the include prefix.
Olaf Schmerse [Mon, 18 Oct 2021 13:42:29 +0000 (15:42 +0200)]
nvme: fail on busy namespace
To avoid formarting a busy namespace accidently a new function called
open_exclusive() is implemented. Instead of opening it always it opens
the device file in exclusive mode (O_EXCL). If this fails with the error EBUSY an error
messages hints to the --force command line option. By calling nvme format with the --force option it
will continue formating the namespace.
This patch fixes issue: #1095 Signed-off-by: Olaf Schmerse <olaf.schmerse@ionos.com>
nvme-rpmb: Add limits.h due to missing PATH_MAX definition
Commit 21f40f38b introduced new use of PATH_MAX, but did not add the
limits.h header. This resulted in nvme-cli failing to build on
ppc64le systems using the musl C library.
Daniel Wagner [Mon, 11 Oct 2021 16:59:22 +0000 (18:59 +0200)]
build: Add support for meson build system
Add meson build system. I tried to mimic the existing Makefile style
but there are a couple of noteworthy differentiation.
- meson has the concept of subprojects. It is able to download (via
git) the dependencies (libnvme) and add them directly into the
build system unless the library is found on the host machine
(PKG_CONFIG_PATH needs to point to libnvme). This makes git
submodules unnecessary. The nice thing is that we get a very simple
setup for CI. meson knows how to download and the dependencies into
the build.
To make all this work the git submodule needs to be removed when we
start using meson to build the project. 'meson dist' bundles
libnvme into the final tar. We could obviously remove it again via
add_dist_script but this seems not worth the time.
- meson uses project_version() to set the version string. This is
usually just a string (or read from a file). I added the script
hack so that we keep the versioning consistent with the Makefile,
e.g. that tar file has the 'git describe' version and 'nvme
--version' says the same. For a new release, the script
'nvme-cli-version' needs to be updated (like NVME-VERSION_GEN) and
the release needs to be tagged before one runs 'meson dist'. I
guess in the long run we could just set the project_version string
in meson.build and introduce a package_version which is based on
git. This is how systemd handles this.
- The github workflow disables the unit tests for nvme-cli (but not
for libnvme) by not installing nose2. Those tests fail at the
moment.
There are still many things very rough or missing, e.g. the install
targets. But this seems like a good first version to get things going.
Daniel Wagner [Thu, 7 Oct 2021 07:06:28 +0000 (09:06 +0200)]
nvme-print: Use array array instead of ccan/list
Commit 155fbebfe7b7 ("Update effects-log to handle multiple command
sets") added a dependency to libvnme/ccan which conflicts with making
the libnvme shared library.
We can simply replace the list by an fixed sized array as we know we
either have 1 or 2 elements in the list.