]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
3 years agoPrint ProductName found even if subvendor/subdevice is unknown
Brandon Paupore [Tue, 17 Aug 2021 17:02:28 +0000 (12:02 -0500)]
Print ProductName found even if subvendor/subdevice is unknown

Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
3 years agoRevert "Bug fix unsigned int and int should use 64bit api for json-c"
Keith Busch [Fri, 6 Aug 2021 20:58:17 +0000 (13:58 -0700)]
Revert "Bug fix unsigned int and int should use 64bit api for json-c"

This reverts commit d127537694e5953551d58acf8717ab1483c38ed3.

3 years agoautoconnect: replace network.target with network-online.target
Maurizio Lombardi [Mon, 21 Jun 2021 08:55:55 +0000 (10:55 +0200)]
autoconnect: replace network.target with network-online.target

Make sure the network card is configured before trying to
connect to the target

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
3 years agoBug fix unsigned int and int should use 64bit api for json-c
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>
3 years agoAdd Identify CNS 0x18 Domain List Support
Gollu Appalanaidu [Mon, 19 Jul 2021 13:57:47 +0000 (19:27 +0530)]
Add Identify CNS 0x18 Domain List Support

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>
3 years agostrip trailing spaces from fabrics output
Keith Busch [Tue, 3 Aug 2021 16:45:22 +0000 (09:45 -0700)]
strip trailing spaces from fabrics output

Link: https://github.com/linux-nvme/nvme-cli/issues/1117
Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agonvme: Bug fix default data_len used if no argument given
Steven Seungcheol Lee [Tue, 3 Aug 2021 04:47:13 +0000 (13:47 +0900)]
nvme: Bug fix default data_len used if no argument given

current logic ignore given data by user
so make priority to use user argument first

this change make available vendor specific command on set-feature, get-feature with data_len

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoremove string representation timestamp set_feature
Keith Busch [Tue, 3 Aug 2021 14:41:58 +0000 (07:41 -0700)]
remove string representation timestamp set_feature

Require the integer representation be provided for this to avoid any
mismatched sizing problems.

Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agofix set_feature formatting
Keith Busch [Tue, 3 Aug 2021 14:23:21 +0000 (07:23 -0700)]
fix set_feature formatting

spaces to tabs, per linux coding style.

Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agonvme: add capacity management command support
Gollu Appalanaidu [Thu, 1 Jul 2021 18:52:11 +0000 (00:22 +0530)]
nvme: add capacity management command support

Host software issues this Capacity Management command to
configure/Create/Delete Endurance Groups and NVM Sets in an
NVM subsystem.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Signed-off-by: Karthik Balan <karthik.b82@samsung.com>
[dwagner: removed nvme-ioctl changes; part of libnvme]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agogen-hostnqn: Remove UUID validation heuristic
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.

Signed-off: Daniel Wagner <dwagner@suse.de>

3 years agoBash completions
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>
3 years agomicron-nvme.h: formatting
Michael Gebis [Tue, 20 Jul 2021 05:40:50 +0000 (22:40 -0700)]
micron-nvme.h: formatting

3 years agonvme: add multiple update detected result value in fw commit
Gollu Appalanaidu [Sat, 3 Jul 2021 18:52:36 +0000 (00:22 +0530)]
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>
3 years agofix boot partitions register show in human readable format
Gollu Appalanaidu [Tue, 20 Jul 2021 08:00:04 +0000 (13:30 +0530)]
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.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
3 years agoChange IOCTL for read, write and compare commands
Gollu Appalanaidu [Mon, 12 Jul 2021 13:37:19 +0000 (19:07 +0530)]
Change IOCTL for read, write and compare commands

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>
3 years agoid-nvmset: Fixed typo
Michael Gebis [Thu, 15 Jul 2021 22:02:30 +0000 (15:02 -0700)]
id-nvmset: Fixed typo

3 years agoUse PRIx64 format specifier instead of lX for more portability.
Sushrut Shirole [Tue, 13 Jul 2021 22:02:53 +0000 (15:02 -0700)]
Use PRIx64 format specifier instead of lX for more portability.

Signed-off-by: Sushrut Shirole <sushrutshirole@gmail.com>
3 years agointel_nvme: fixed typo
FrancisPravin [Mon, 12 Jul 2021 14:35:15 +0000 (20:05 +0530)]
intel_nvme: fixed typo

3 years agowdc-nvme: fix uclibc compilation.
Sushrut Shirole [Fri, 9 Jul 2021 21:22:20 +0000 (14:22 -0700)]
wdc-nvme: fix uclibc compilation.

3 years agonvme add Storage Tag Check field in NVM Commands
Gollu Appalanaidu [Fri, 9 Jul 2021 08:19:58 +0000 (13:49 +0530)]
nvme add Storage Tag Check field in NVM Commands

Add Storage Tag Check(STC) field in Write, Read, Compare,
Write Zeroes and Verify commands

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: changed NVME_RW_STORAGE_TAG_CHECK to NVME_SC_STORAGE_TAG_CHECK]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: add CDW2 and CDW3 support for Write Zeroes and Verify Command
Gollu Appalanaidu [Thu, 8 Jul 2021 16:25:22 +0000 (21:55 +0530)]
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>
3 years agonvme: add verify command man page
Gollu Appalanaidu [Tue, 6 Jul 2021 20:08:23 +0000 (01:38 +0530)]
nvme: add verify command man page

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
3 years agonvme: add status to error number for id_uuid and verify_cmd
Gollu Appalanaidu [Mon, 14 Jun 2021 19:23:20 +0000 (00:53 +0530)]
nvme: add status to error number for id_uuid and verify_cmd

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
3 years agonvme: add lsp and uuid index invalid value checks in get log
Gollu Appalanaidu [Thu, 27 May 2021 06:23:40 +0000 (11:53 +0530)]
nvme: add lsp and uuid index invalid value checks in get log

Add the invalid LSP and UUID Index value checks as per the field
lengths. Refactor the get_log function.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: updated context in get_log() and error handling]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: add identify controller structure 2.0 spec. fields
Gollu Appalanaidu [Fri, 11 Jun 2021 21:24:56 +0000 (02:54 +0530)]
nvme: add identify controller structure 2.0 spec. fields

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: ported from nvme-cli-monolithic branch]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme: fix the fw-log structure and show fw log changes
Gollu Appalanaidu [Fri, 18 Jun 2021 18:07:53 +0000 (23:37 +0530)]
nvme: fix the fw-log structure and show fw log changes

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
3 years agonvme: add missing endianness annotations
Gollu Appalanaidu [Thu, 17 Jun 2021 17:39:58 +0000 (23:09 +0530)]
nvme: add missing endianness annotations

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: dropped libnvme changes]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoChanges requested by keithbusch; no default for cfg.tl.
fixthething [Sun, 14 Mar 2021 00:02:00 +0000 (19:02 -0500)]
Changes requested by keithbusch; no default for cfg.tl.

[dwagner: updated nvme_secure_send() arguments]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoDoing dword alignment whether source of misalignment comes from file size or specifie...
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.

3 years agoMaking security-send command more flexible by allowing data from stdin, and assuming...
fixthething [Sat, 6 Mar 2021 15:23:50 +0000 (10:23 -0500)]
Making security-send command more flexible by allowing data from stdin, and assuming transfer length to match input size if not specified.

[dwagner: updated nvme_secure_send() arguments]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1232 from MatiasBjorling/improve_zns_desc
Daniel Wagner [Mon, 15 Nov 2021 10:59:01 +0000 (11:59 +0100)]
Merge pull request #1232 from MatiasBjorling/improve_zns_desc

nvme: refactor the list of ZNS command

3 years agonvme: refactor the list of ZNS command
Matias Bjørling [Thu, 11 Nov 2021 16:15:26 +0000 (16:15 +0000)]
nvme: refactor the list of ZNS command

Refactor the commands available in the zns plugin, such that the most used
comes first.

Signed-off-by: Matias Bjørling <matias.bjorling@wdc.com>
3 years agoMerge pull request #1228 from igaw/fix-jsonc-config
Daniel Wagner [Mon, 8 Nov 2021 09:51:22 +0000 (10:51 +0100)]
Merge pull request #1228 from igaw/fix-jsonc-config

build: Use CONFIG_JSONC consistently

3 years agobuild: Use CONFIG_JSONC consistently
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.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1222 from linux-nvme/fix-build-config
Daniel Wagner [Tue, 2 Nov 2021 12:49:06 +0000 (13:49 +0100)]
Merge pull request #1222 from linux-nvme/fix-build-config

Fix build config

3 years agoworkflow: Disable tests for libnvme
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.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Prefix configuration switches
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.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Rename default include header file
Daniel Wagner [Tue, 2 Nov 2021 12:19:00 +0000 (13:19 +0100)]
build: Rename default include header file

Rename config-host.h to config.h as it contains also the defines for
the ccan library, e.g. HAVE_BIG_ENDIAN.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1206 from igaw/revert-use-array
Daniel Wagner [Tue, 2 Nov 2021 12:08:03 +0000 (13:08 +0100)]
Merge pull request #1206 from igaw/revert-use-array

Revert use array

3 years agoMerge pull request #1216 from ikegami-t/get-feature-fids-2
Daniel Wagner [Thu, 28 Oct 2021 12:33:53 +0000 (14:33 +0200)]
Merge pull request #1216 from ikegami-t/get-feature-fids-2

Change get feature command to output multiple features

3 years agonvme: add select 1000b to get feature changed from default
Tokunori Ikegami [Sun, 23 May 2021 10:15:15 +0000 (19:15 +0900)]
nvme: add select 1000b to get feature changed from default

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agonvme: change get_feature to get multiple feature ids
Tokunori Ikegami [Tue, 26 Oct 2021 16:55:41 +0000 (01:55 +0900)]
nvme: change get_feature to get multiple feature ids

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agonvme: split get_feature to get multiple feature ids
Tokunori Ikegami [Thu, 20 May 2021 17:40:07 +0000 (02:40 +0900)]
nvme: split get_feature to get multiple feature ids

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agoMerge pull request #1211 from ikegami-t/nvme-print-2
Daniel Wagner [Wed, 27 Oct 2021 09:13:15 +0000 (11:13 +0200)]
Merge pull request #1211 from ikegami-t/nvme-print-2

nvme-print: Changes for id-ctrl and degree celsius prints

3 years agoMerge pull request #1214 from AkhileshRN/SN_Updates
Daniel Wagner [Tue, 26 Oct 2021 09:21:30 +0000 (11:21 +0200)]
Merge pull request #1214 from AkhileshRN/SN_Updates

Added support for SN810, SN530 and SN740 series NVMe SSDs

3 years agoAdded support for SN810, SN530 and SN740 series NVMe SSDs
Akhilesh RN [Mon, 25 Oct 2021 11:37:07 +0000 (17:07 +0530)]
Added support for SN810, SN530 and SN740 series NVMe SSDs

3 years agonvme-print: Add elpe, npss, tnvmcap and unvmcap human readable formats
Tokunori Ikegami [Fri, 7 May 2021 18:04:44 +0000 (03:04 +0900)]
nvme-print: Add elpe, npss, tnvmcap and unvmcap human readable formats

3 years agonvme-print: Add mntmt and mxtmt human readable formats
Tokunori Ikegami [Fri, 7 May 2021 17:41:42 +0000 (02:41 +0900)]
nvme-print: Add mntmt and mxtmt human readable formats

3 years agonvme-print: MAINT: Fix wctemp and cctemp description as specification
Tokunori Ikegami [Fri, 7 May 2021 17:39:28 +0000 (02:39 +0900)]
nvme-print: MAINT: Fix wctemp and cctemp description as specification

3 years agonvme-print: Print degree celsius as °C instead of C
Tokunori Ikegami [Fri, 7 May 2021 17:14:14 +0000 (02:14 +0900)]
nvme-print: Print degree celsius as  °C instead of C

3 years agonvme-print: MAINT: Fix wctemp and cctemp 16 bits width print
Tokunori Ikegami [Fri, 7 May 2021 17:02:43 +0000 (02:02 +0900)]
nvme-print: MAINT: Fix wctemp and cctemp 16 bits width print

3 years agoRevert "nvme-print: Use array array instead of ccan/list"
Daniel Wagner [Thu, 21 Oct 2021 11:06:40 +0000 (13:06 +0200)]
Revert "nvme-print: Use array array instead of ccan/list"

This reverts commit cf2ab19f1881a8945bb07fa42dbbc018fc55f797.

3 years agoccan: Add ccan/list
Daniel Wagner [Thu, 21 Oct 2021 11:49:11 +0000 (13:49 +0200)]
ccan: Add ccan/list

In order to be able to revert cf2ab19f1881 ("nvme-print: Use array
array instead of ccan/list") we need to add the list helper from ccan.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1209 from hreinecke/anacap
Daniel Wagner [Fri, 22 Oct 2021 07:01:22 +0000 (09:01 +0200)]
Merge pull request #1209 from hreinecke/anacap

nvme-print: invert logic in ANACAP bit 6

3 years agoMerge pull request #1210 from hreinecke/dlfeat
Hannes Reinecke [Fri, 22 Oct 2021 07:01:02 +0000 (09:01 +0200)]
Merge pull request #1210 from hreinecke/dlfeat

nvme-print: add 'dlfeat' to json output

3 years agonvme-print: add 'dlfeat' to json output
Hannes Reinecke [Fri, 22 Oct 2021 06:57:04 +0000 (08:57 +0200)]
nvme-print: add 'dlfeat' to json output

Missing from json output.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agonvme-print: invert logic in ANACAP bit 6
Hannes Reinecke [Fri, 22 Oct 2021 06:50:46 +0000 (08:50 +0200)]
nvme-print: invert logic in ANACAP bit 6

As per spec ANACAP bit 6 indicates if the ANA group ID is static
(ie does not change).

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #1205 from igaw/remove-endian-info
Daniel Wagner [Thu, 21 Oct 2021 11:53:04 +0000 (13:53 +0200)]
Merge pull request #1205 from igaw/remove-endian-info

build: Remove ccan/endian/info

3 years agobuild: Remove ccan/endian/info
Daniel Wagner [Thu, 21 Oct 2021 10:52:23 +0000 (12:52 +0200)]
build: Remove ccan/endian/info

7ba0a5382d06 ("meson,Makefile: fix build") added accidentially the
binary. We don't need it, let's remove it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1204 from birkelund/fix-build
Daniel Wagner [Thu, 21 Oct 2021 10:38:00 +0000 (12:38 +0200)]
Merge pull request #1204 from birkelund/fix-build

meson,Makefile: fix build

3 years agomeson,Makefile: fix build
Klaus Jensen [Thu, 21 Oct 2021 09:59:34 +0000 (11:59 +0200)]
meson,Makefile: fix build

Since libnvme commit 2e3616eaf0ed, the endian helpers are no longer
exported. Instead, use ccan/endian and add it to the build systems.

Meson will always checkout head of libnvme, but for the make-based
building, this requires a bump of libnvme for the submodule.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
3 years agoMerge pull request #1201 from ikegami-t/hex-digits-2
Daniel Wagner [Thu, 21 Oct 2021 08:29:23 +0000 (10:29 +0200)]
Merge pull request #1201 from ikegami-t/hex-digits-2

nvme: Fix to print get and set feature hex digits correct width

3 years agoMerge pull request #1202 from igaw/json-c.wrap
Daniel Wagner [Thu, 21 Oct 2021 08:19:47 +0000 (10:19 +0200)]
Merge pull request #1202 from igaw/json-c.wrap

build:  Add missing json-c.wrap

3 years agobuild: Add missing json-c.wrap
Daniel Wagner [Thu, 21 Oct 2021 07:31:36 +0000 (09:31 +0200)]
build:  Add missing json-c.wrap

Commit cad1ef9710f3 ("build: Set minimum version for json-c and add
fallback support") is missing the json-c wrap file.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1198 from suz-yang/resv_report_fix
Daniel Wagner [Thu, 21 Oct 2021 07:27:11 +0000 (09:27 +0200)]
Merge pull request #1198 from suz-yang/resv_report_fix

nvme: fix wrong parameter passed to nvme_resv_report

3 years agonvme: Fix to print get and set feature hex digits correct width
Tokunori Ikegami [Wed, 20 Oct 2021 16:32:13 +0000 (01:32 +0900)]
nvme: Fix to print get and set feature hex digits correct width

Previously 2 hex digits not printed as "0x" was included the width specified.
To resolve this increase 2 digits number more if the value is not zero.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agonvme: use the 'eds' command line option replace the 'cdw11' command line option in...
suzhi.yt [Wed, 20 Oct 2021 02:34:04 +0000 (10:34 +0800)]
nvme: use the 'eds' command line option replace the 'cdw11' command line option in resv-report

Signed-off-by: suzhi.yt <suzhi.yt@antgroup.com>
3 years agoMerge pull request #1199 from leongross/fix/nvme-connect-docs
Daniel Wagner [Tue, 19 Oct 2021 11:55:27 +0000 (13:55 +0200)]
Merge pull request #1199 from leongross/fix/nvme-connect-docs

fix minor doc issues

3 years agofix minor doc issues
leongross [Tue, 19 Oct 2021 11:44:44 +0000 (13:44 +0200)]
fix minor doc issues

3 years agoMerge pull request #1196 from igaw/set-min-json-version
Daniel Wagner [Tue, 19 Oct 2021 09:34:51 +0000 (11:34 +0200)]
Merge pull request #1196 from igaw/set-min-json-version

build: Set minimum version for json-c

3 years agobuild: Set minimum version for json-c and add fallback support
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.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Update libnvme dependency
Daniel Wagner [Tue, 19 Oct 2021 09:19:01 +0000 (11:19 +0200)]
build: Update libnvme dependency

libnvme cleaned up the libnvme dependency. Update the fallback
accordinly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1197 from olase23/fail-on-busy-namespaceII
Hannes Reinecke [Tue, 19 Oct 2021 08:29:10 +0000 (10:29 +0200)]
Merge pull request #1197 from olase23/fail-on-busy-namespaceII

nvme: fail on busy namespace

3 years agonvme: fix wrong parameter passed to nvme_resv_report
suzhi.yt [Tue, 19 Oct 2021 07:07:27 +0000 (15:07 +0800)]
nvme: fix wrong parameter passed to nvme_resv_report

Signed-off-by: suzhi.yt <suzhi.yt@antgroup.com>
3 years agonvme: fail on busy namespace
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>
3 years agoMerge pull request #1195 from igaw/fix-limit-h-v2
Daniel Wagner [Mon, 18 Oct 2021 13:45:26 +0000 (15:45 +0200)]
Merge pull request #1195 from igaw/fix-limit-h-v2

nvme-rpmb: Add limits.h due to missing PATH_MAX definition

3 years agoMerge pull request #1081 from ikegami-t/short-command
Daniel Wagner [Mon, 18 Oct 2021 13:09:52 +0000 (15:09 +0200)]
Merge pull request #1081 from ikegami-t/short-command

plugin: Allow to handle complementable short command

3 years agonvme-rpmb: Add limits.h due to missing PATH_MAX definition
Ariadne Conill [Mon, 26 Apr 2021 06:41:20 +0000 (00:41 -0600)]
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.

Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
[dwagner: removed nvme-topology.c bits]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1193 from igaw/meson
Daniel Wagner [Mon, 18 Oct 2021 09:54:41 +0000 (11:54 +0200)]
Merge pull request #1193 from igaw/meson

build: Add support for meson build system

Let's add the meson build framework. It still needs some more cleanups but we can
do this incremental in the tree.

The Makefiles are still in place so there no 'Disturbance in the Force'.

3 years agobuild: Add support for meson build system
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.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1194 from jeffreyalien/master
Daniel Wagner [Wed, 13 Oct 2021 06:51:06 +0000 (08:51 +0200)]
Merge pull request #1194 from jeffreyalien/master

[nvme-cli] Prevent nvme_free call on NULL buffer

3 years ago[nvme-cli] Fix indentation
Jeff Lien [Tue, 12 Oct 2021 20:37:02 +0000 (15:37 -0500)]
[nvme-cli] Fix indentation

3 years ago[nvme-cli] Prevent nvme_free call on NULL buffer
Jeff Lien [Tue, 12 Oct 2021 19:15:10 +0000 (14:15 -0500)]
[nvme-cli] Prevent nvme_free call on NULL buffer

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agonvme: Update argconfig include
Daniel Wagner [Mon, 11 Oct 2021 16:13:04 +0000 (18:13 +0200)]
nvme: Update argconfig include

argconfig.h is lives in the util directory. Update the
include.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme-status: Remove unused files
Daniel Wagner [Mon, 11 Oct 2021 16:11:56 +0000 (18:11 +0200)]
nvme-status: Remove unused files

With the libnvme refactorying these files are left overs which are not
used anymore. Remove them.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1190 from jeffreyalien/master
Daniel Wagner [Mon, 11 Oct 2021 08:02:47 +0000 (10:02 +0200)]
Merge pull request #1190 from jeffreyalien/master

[nvme-cli] Add support for additional SN650 pci id

3 years ago[nvme-cli] Add support for additional SN650 pci id
Jeff Lien [Thu, 7 Oct 2021 20:32:30 +0000 (15:32 -0500)]
[nvme-cli] Add support for additional SN650 pci id

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agoMerge pull request #1178 from verschwindibussen/external-libnvme
Daniel Wagner [Thu, 7 Oct 2021 15:21:14 +0000 (17:21 +0200)]
Merge pull request #1178 from verschwindibussen/external-libnvme

Support to shared libnvme builds

3 years agoMerge pull request #1188 from igaw/drop-ccan-dependency
Hannes Reinecke [Thu, 7 Oct 2021 07:44:53 +0000 (09:44 +0200)]
Merge pull request #1188 from igaw/drop-ccan-dependency

nvme-print: Use array array instead of ccan/list

3 years agonvme-print: Use array array instead of ccan/list
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.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1183 from hanumanthuh/master
Hannes Reinecke [Wed, 6 Oct 2021 15:39:25 +0000 (17:39 +0200)]
Merge pull request #1183 from hanumanthuh/master

Extended SMART log parsing support

3 years agoMerge pull request #1187 from hreinecke/libnvme-update
Hannes Reinecke [Wed, 6 Oct 2021 15:29:11 +0000 (17:29 +0200)]
Merge pull request #1187 from hreinecke/libnvme-update

Update libnvme to current master

3 years agoUpdate libnvme to current master
Hannes Reinecke [Wed, 6 Oct 2021 15:21:36 +0000 (17:21 +0200)]
Update libnvme to current master

Update the libnvme submodule reference for the current libnvme HEAD.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #1186 from hreinecke/gcc-fixes
Hannes Reinecke [Wed, 6 Oct 2021 15:22:33 +0000 (17:22 +0200)]
Merge pull request #1186 from hreinecke/gcc-fixes

Fixup compiler warnings

3 years agoFixup compiler warnings
Hannes Reinecke [Wed, 6 Oct 2021 15:12:07 +0000 (17:12 +0200)]
Fixup compiler warnings

Compiling with additional compiler options generates some warnings;
fix them.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agopoint libnvme remote to correct upstream
Keith Busch [Wed, 6 Oct 2021 11:15:35 +0000 (04:15 -0700)]
point libnvme remote to correct upstream

3 years agoFix a bug where CSI was not handled in nvme create-ns
Andreas Hindborg [Wed, 6 Oct 2021 11:11:21 +0000 (04:11 -0700)]
Fix a bug where CSI was not handled in nvme create-ns

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agoupdate libnvme
Keith Busch [Wed, 6 Oct 2021 11:08:29 +0000 (04:08 -0700)]
update libnvme

3 years agoFix dead assignment
Andreas Hindborg [Thu, 16 Sep 2021 05:30:37 +0000 (05:30 +0000)]
Fix dead assignment

This patch fixes a bug in the error handling in `zns_mgmt_send`, where error
cause was not reported correctly.

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>