spec, Makefile: add /etc/nvme files to package files
This way it can automatically be removed upon uninstallation
and we don't need %preun target. Also, this will also allow
to get these files on manual installation from sources.
Also, don't settle on the "file exists" check, use the '-s'
to check that it is not empty as well.
Lastly, in order to have hostnqn and hostid updated upon pkg
install, we have install-spec target that would omit hostnqn and
hostid files, and let the rpm %post do it (otherwise we
use the normal install target).
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Minwoo Im [Wed, 24 Apr 2019 00:48:58 +0000 (01:48 +0100)]
ioctl: Fix wrong return case of get_property
If get_property_helper() succeeds in the first time, and then fails in
the next time, then the ret value will not be updated to an error value.
This patch removes 'ret' variable to make 'err' to return being updated
everytime get_property_helper() invoked.
- ontap_vol is a constant char pointer, set to "/vol/", so 5 bytes
- vol_name's size is ONTAP_LABEL_LEN, which is 260, deducting the
null-byte for termination makes 259 required bytes
- "/" is 1 byte
- ns_name's size is also ONTAP_LABEL_LEN, which is 260, deducting
the null-byte for termination makes 259 required bytes
- the final null-byte: 1
That makes in total 5 + 259 + 1 + 259 + 1 = 525 required bytes
Signed-off-by: Simon Schricker <sschricker@suse.de>
Andy Lutomirski [Mon, 15 Apr 2019 17:48:05 +0000 (10:48 -0700)]
Fix passing CFLAGS on the make command line.
Commit 254bcd6b2343 ("Fix CFLAGS parameter") only fixed the problem
if the variable came from the environment, not if it came from the
command line. Fix it using 'override'. See the GNU Make manual,
section 6.7 ("Overriding variables") for details.
Alexander Larin [Thu, 11 Apr 2019 14:11:50 +0000 (17:11 +0300)]
Use 0x prefix for all hex values of id-ctrl output
Sometimes human-readable id-ctrl output could be confusing, e.g.
$ nvme id-ctrl /dev/nvme0
NVME Identify Controller:
vid : 0x144d
ssvid : 0x144d
sn : S3HDNX0K601842
mn : SAMSUNG MZWLL1T6HEHP-00003
fr : GPNA5B3Q
rab : 8
ieee : 002538
cmic : 0x3
mdts : 5
cntlid : 21
...
Here cntlid value is hexdecimal and equals 33, but nothing shows that.
In the same time some other values have 0x prefix. Let's use the prefix
for all hexdecimal values of the output.
Signed-off-by: Alexander Larin <znahar@yandex-team.ru>
Minwoo Im [Thu, 11 Apr 2019 12:51:19 +0000 (21:51 +0900)]
plugin: Return EINVAL instead of ENOTTY
When a given string for a subcommand is not valid, we can return EINVAL which
means invalid arguments. ENOTTY is used to indicate that an invalid IOCTL
number was specified.
Keith Busch [Tue, 9 Apr 2019 21:32:46 +0000 (15:32 -0600)]
Release for new stable fixes
There's been a few fixes since the last tag that are fairly critical for
some scenarios, so we're tagging a new one already. Since these are all
just fixes and no new features, we'll add an additional minor digit to
the revision.
Signed-off-by: Keith Busch <keith.busch@intel.com>
James Smart [Tue, 9 Apr 2019 20:51:54 +0000 (13:51 -0700)]
nvme-cli: Revert stop-on-failure with connect-all
The patch that added special treatment for EALREADY connect failures
also changed the behavior on what happens if a discovery log contains
an entry that is not connectable by the system or host port. If it
encounters a log entry that can't be connected to, it will not attempt
to connect to any log entries beyond it. This can leave lots of devices
unconnected to.
Revert the stop-on-failure introduced by the previous patch.
Specifically, this failed for me on an FC array that had a discovery log
entry for a port that was not visible via zoning for the initiator
port being used.
Fixes: 1a922e0e121d7 ("connect-all: special treatment to EALREADY afetr write to /dev/nvme-fabrics" Signed-off-by: James Smart <jsmart2021@gmail.com> CC: Eyal Ben David <eyalbe@il.ibm.com> CC: Martin George <Martin.George@netapp.com>
Keith Busch [Mon, 8 Apr 2019 20:51:59 +0000 (14:51 -0600)]
Release version 1.8
There are some important fixes pending a release tag, so now seems as
good as any to tag the release.
Thank you again to everyone who's contribute to this round. Shortlog
below.
Breno Leitao (2):
Fix compilation with GCC-8
Fix CFLAGS parameter
Chaitanya Kulkarni (3):
nvme-cli: fix compilation with uint64_t cast
nvme-cli: minor cleanup for submit_io()
nvme-cli: align all the macros
Dong Ho (11):
wdc: Change device capability checking
wdc: Add additional device for vs-internal-log
wdc: Add device unit info log extraction
wdc: Add get drive status command
wdc: Add clear assert dump status command
wdc: Add drive resize command
wdc: Update device capabilities for clear pcie corr
wdc: Update file parameter checking
wdc: Add command to extract NAND statistics
wdc: Add data area extraction for DUI command
wdc: Additional device capabilities check
James Smart (1):
nvme-cli: fix fc trtype string
Jeffrey Lien (3):
NVMe-CLI WDC Plugin - add support for additional SN840 device ID.
WDC plugin Change vs-internal-log Command to Save Partial E6 Log Data.
WDC Plugins vs-internal-log command unsupported on SN340.
Keith Busch (8):
generate new documentation
Regen docs
Fix print format specifiers
Regen documentation
Add new docs to repository
Generate new documentation
Fix format block size usage
Regen documentation
Kenneth Heitke (4):
Add reporting of Virtual Management support to id-ctrl
Fix possible NULL pointer dereferences
Fix possible memory leak on get-internal-log
Print timestamp as a date and time string
Martin George (2):
nvme-cli: add netapp ontapdevices command
nvme-cli: add netapp ontapdevices man page
Maxim (1):
Adding a helper to format command to enable the user to specify desired block size and have nvme-cli determine the correct LBAF and add format helper to nvme-create-ns command
Minwoo Im (15):
fabrics: Return negative errno when asprintf() fails
fabrics: Return negative errno to check remove_ctrl() is failed
doc: Update nvme-discover by describing options
doc: Update nvme-connect by describing options
doc: Update nvme-connect-all by describing options
doc: Update nvme-disconnect by describing options
doc: Add missing commands to main document entry
nvme: Support raw_binary and json format for show-regs
doc: Update show-regs document with output-format
ioctl: Free memory if get_property for fabrics failed
nvme: Use ARRAY_SIZE() macro in common.h
nvme: Unify min(), max() macro as a common one
nvme: Simplify description for virt-mgmt
nvme: Simplify virt-mgmt options to lowercase
tests: Update print to print() for python3
Roy Shterman (1):
nvme-print: Fix evaluation of ctratt on pretty print
Sagi Grimberg (1):
nvme: print I/O error to stderr
Signed-off-by: Keith Busch <keith.busch@intel.com>
Minwoo Im [Sun, 7 Apr 2019 11:24:55 +0000 (20:24 +0900)]
tests: Update print to print() for python3
The following issue has been reported that README in "tests" seems not
correct because it will not be able to be invoked in case python3
because print() has to be taken instead of print which had been used for
python2.
Minwoo Im [Sun, 7 Apr 2019 10:32:53 +0000 (19:32 +0900)]
nvme: Simplify virt-mgmt options to lowercase
All the other subcommand options are supported with lowercase, but
virt-mgmt subcommand has long argument name started with uppercase.
This can be simplified to a lowercase with being the same with the names
on spec document.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Sun, 7 Apr 2019 10:30:25 +0000 (19:30 +0900)]
nvme: Simplify description for virt-mgmt
The options of virt-mgmt subcommand can be simplified for a good
readability. This patch not only adds necessary whitespace between
sentences, but remove unnecessary empty line and words which might cause
too long line to describe options.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Sat, 6 Apr 2019 21:45:16 +0000 (06:45 +0900)]
ioctl: Free memory if get_property for fabrics failed
The given *pbar is allocated inside this function without freeing it
will be freed from the caller in case of show-regs subcommand for NVMe-oF
controller.
If Get Property is failed because it has PCIe transport, then it needs
to be freed here instead of caller.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Sat, 6 Apr 2019 21:01:17 +0000 (06:01 +0900)]
nvme: Support raw_binary and json format for show-regs
Somebody might want to compare entire controller registers in a raw
binary format to check controller status or some of configurations. It
also can be needed to print out JSON format for easily parsing.
This patch introduces JSON and RAW_BINARY print format with a general
--output-format argument. This will have "normal" value by default, and
also support "json" and "binary".
We don't care about whether the given "fabrics" argument in
json_ctrl_registers() because all the reserved registers and fields are
to be returned as 0x0 as specified in NVMe-oF "Property Definitions"
section.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 3 Apr 2019 16:30:33 +0000 (01:30 +0900)]
doc: Add missing commands to main document entry
cmds-main.txt has the entire command sets provided by nvme-cli. This
patch added the following commands which has already had corresponding
documents already.
1. nvme-connect-all
2. nvme-disconnect
2. nvme-disconnect-all
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 3 Apr 2019 16:27:17 +0000 (01:27 +0900)]
doc: Update nvme-connect-all by describing options
We have had newly added command options for Connect to all NVMe-oF subsystems.
This patch updates descriptions of command options.
+ This patch also fixes an trivial mis-aligned paragraph issue which can
be in this commit to avoid any confusions in document update which might
show too many diffs.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 3 Apr 2019 16:24:07 +0000 (01:24 +0900)]
doc: Update nvme-discover by describing options
We have had newly added command options for Discover controller. This
patch updates descriptions of command options.
+ This patch also fixes an trivial mis-aligned paragraph issue which can
be in this commit to avoid any confusions in document update which might
show too many diffs.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 3 Apr 2019 15:02:05 +0000 (00:02 +0900)]
fabrics: Return negative errno to check remove_ctrl() is failed
remove_ctrl() might fail due to a reason such as memory allocation
failure. Once it fails, discovery should not proceed, but return the
errorno to the caller immediately.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 3 Apr 2019 14:53:33 +0000 (23:53 +0900)]
fabrics: Return negative errno when asprintf() fails
asprintf() will return -1 when it fails to allocate memory for the
string given with setting errno to ENOMEM. For the uniformity, we can
return errno with negative value.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Chaitanya Kulkarni [Wed, 6 Feb 2019 22:59:56 +0000 (14:59 -0800)]
nvme-cli: align all the macros
Due to the addition of a lot of code in the WDC Plugin over a period
of time it has non-aligned macro definitions. This is purely cleanup
patch which makes all the macros aligned nicely which makes code
readable.
James Smart [Mon, 4 Feb 2019 21:39:54 +0000 (13:39 -0800)]
nvme-cli: fix fc trtype string
Commit 55b4ec12ffe4
("fabrics: use trtype_str when parsing a discovery log entry")
changed to use the trtypes string names in a generic fashion for
the "transport=?" string passed in the connect string to the kernel.
For FC, this meant the hardcoding of "transport=fc" was removed and
the generic code would now create "transport=fibre-channel", which
doesn't match any transport name anymore once the string is attempted
to be matched in the kernel.
Change the string used by for trtype for FC to use "fc" to restore
operation.
Maxim [Wed, 23 Jan 2019 23:12:36 +0000 (15:12 -0800)]
Adding a helper to format command to enable the user to specify desired block size and have nvme-cli determine the correct LBAF and add format helper to nvme-create-ns command
Breno Leitao [Mon, 21 Jan 2019 12:03:24 +0000 (07:03 -0500)]
Fix CFLAGS parameter
Currently nvme-cli 1.7 is not compiling on Debian because the Debian helper
(compilation toolkit) does pass a CFLAGS variable, thus, avoiding the
initial definition (CFLAGS ?= -O2 -g -Wall -Werror -I.)
The problem is that -I should not be removed, otherwise the code does not
compile, with the following bug:
cc -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D__CHECK_ENDIAN__ -g -O2 -fdebug-prefix-map=/home/breno/nvme/nvme-cli-1.7=. -fstack-protector-strong -Wformat -Werror=format-security -std=gnu99 -DLIBUUID -DNVME_VERSION='"1.7"' -o plugins/intel/intel-nvme.o -c plugins/intel/intel-nvme.c
plugins/intel/intel-nvme.c:10:18: fatal error: nvme.h: No such file or directory
compilation terminated.
This patch just moves the -I parameter to part of the CFLAGS that is not
replaced by dh's CFLAGS.
Breno Leitao [Mon, 21 Jan 2019 11:31:15 +0000 (06:31 -0500)]
Fix compilation with GCC-8
Printf() is being called to print an unsigned long int using the long long
identifier. This causes the following error with GCC-8:
nvme.c:3056:5: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
"Invalid value for block size (%llu), must be a power of two\n",
^
nvme.c:3091:6: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
"LBAF corresponding to block size %llu (LBAF %u) not found\n",
Adjusting the printf arguments to print the proper format.
Dong Ho [Fri, 11 Jan 2019 00:37:06 +0000 (00:37 +0000)]
wdc: Change device capability checking
Changes the way device VID and type are checked for compatibility
purposes. Other minor changes for command names, update the respective
documentation file names, and remove deprecated C1 log functionality.
Keith Busch [Fri, 11 Jan 2019 00:25:03 +0000 (17:25 -0700)]
nvme: Release 1.7
Thank you to all the contributions in this release. Lots of new options,
spec features, output updates, and bug fixes. Shortlog below.
Austin J Eberle (1):
nvme-cli: prevent resv action field overflow
Benreese0 (1):
nvme: Adding a block size selector to format
Chaitanya Kulkarni (23):
nvme-cli: remove unnecessary assignments
nvme-cli add ns write protect feature support
nvme-cli: add minimal ana-log page support
nvme-cli: add ana-log documentation
nvme-cli: make show_registers_cap() static
nvme-cli: wdc-plugin mark array static declaration
nvme-cli: fix sparse warnings for declaration
nvme-cli: don't use unsigned for fd in lnvm-nvme.c
nvme-cli: remove always true condition for u8
nvme-cli: fix dead-code nvmf log page discovery
nvme-cli: code cleanup for passthru() handlers
nvme-cli: fix scaandir() return value
nvme-cli: use uniform error message for open
nvme-cli: fix indentation
nvme-cli: make wdc plug-in functions static
nvme-cli: mark functions static
nvme-cli: make malloc error handling uniform
nvme-cli: fix indentation for dir_[send/receive]
nvme-cli: make read error handling uniform
nvme-cli: fix sanitize status endianness
nvme-cli: fix ana-log endianness
nvme-cli: fix array len to hold string of size 4
nvme-cli: fix endianness for the structure field
Dan Bond (1):
README: update Arch Linux install instructions
David Milburn (1):
nvme-cli: report subsystem-reset not supported by controller
Dong Ho (6):
nvme-cli: tests: fix fw_log test coding style
nvme-cli: tests: fix id_ctrl test coding style
nvme-cli: tests: fix id_ns test coding style
nvme-cli: tests: Add get_id_ctrl function
nvme-cli wdc plugin: Add get pfail dump command.
nvme-cli wdc plugin: Add documentation for pfail dump.
Eyal Ben David (8):
nvme-print.c : fix ns-descs JSON output
nvme-get-property : Add documentation
nvme-models.c - search for pci.ids
nvme list : fix nvme list output if identify failed on device
attach-ns : fix segfault for ctrl list wrong input
nvme.spec.in : fix bash completion path, require
Refactor plugins in a file hierarchy
connect-all: special treatment to EALREADY afetr write to /dev/nvme-fabrics
Hannes Reinecke (13):
nvme-ana-log: fixup compiler warning in show_ana_log()
nvme-vendor: fixup c99 declaration in huawei plugin
nvme-discover: sanitize options
nvme-discover: Retry discovery log if the generation counter changes
nvme-ioctl: retrieve log pages in 4k chunks
nvme-discover: Re-check generation counter after log page transfer
seagate-nvme: fixup coding style
nvme-cli: Add 'rae' argument to nvme_get_log()
nvme-cli: kill nvme_passthru_admin()
nvme: fixup ANA group descriptor offset
nvme: introduce get_nvme_ctrl_attr()
nvme: print out controller state for 'list-subsys'
nvme-list-subsys: Add device name argument and print out ANA state
Harry Mallon (3):
micron-nvme: Replace direct use of ioctl
Fix typos in docs
Fix typos in tests and utils
Jeff Lien (1):
nvme-cli: Fix the displayed metadata length value on Big Endian systems.
Jeffrey Lien (5):
Add PCI device id checking for the WDC plugin commands.
Fix nvme test device selection to use controller value defined in the config.json file. Before this fix, the value was hard coded to nvme0.
NVMe-CLI WDC Plugin - Simplify the device id checking routines.
nvme-cli: Add wdc-plugin command vs-internal-log and update wdc-plug cap-diag command with transfer-size parameter.
nvme-cli: Add help text for wdc-plugin command vs-internal-log. Update help text for wdc-plugin command cap-diag.
Johannes Thumshirn (2):
fabrics: write ctrl_loss_tmo to fabrics device on connect
fabrics: write keep-alive-timeout to fabrics device on connect
Keith Busch (15):
Fix print format specifier for 64-bit
Fix nvme id namespace struct
Regen documentation
Update gitignore for generated test files
Update documentation
Re-gen documentation for new files
wdc: Fix strncpy warning
wdc: Use const string for suffix
nvme: Handle supported capabilities result for get features
list-subsys: Preserve line breaks and spaces
Regen documentation
nvme-cli: Don't print result on passthru error
Update documentation
nvme: Regenerate documentation
nvme: Remove duplicate error message
M. Warner Losh (2):
Initialize line.
Use standard interfaces to get timezone offsets.
Minwoo Im (2):
nvme-cli: fix typo in json_print_list_items
nvme-cli: readme: fix typo in Alpine distro support
Narasimhan V (1):
Use tnvmcap register for creating namespace
Peter Dave Hello (1):
Enable code block syntax highlight in README.md
Ralph Corderoy (1):
Enlarge local char[] so snprintf(3) can't truncate path.
Rami Rosen (2):
nvme-cli: fix a typo
nvme-cli: fix a typo
Sagi Grimberg (13):
fabrics: make some arguments integers
fabrics: don't fail empty discovery log page
nvme: commonize subsystems info in a helper
fabrics: add disconnect-all command
fabrics: support fabrics sq flow control disable
fabrics: use trtype_str when parsing a discovery log entry
nvme: Add TCP transport
fabrics: add tcp port tsas decoding
fabrics: add transport header and data digest
nvme-ioctl: clear rae for discovery log pages
fabrics: pass in number of write queues
fabrics: pass in number of polling queues
fabrics: allow nr_io/write/poll_queues and queue size to discovery
Schremmer, Steven (1):
nvme-cli: netapp plugin handle empty strings
Stefan Wiehler (1):
Makefile: fix bash completion install path
Sushma Kalakota (1):
Added support for virtualization-management command
Tal Shorer (1):
don't execute a command if --dry-run is supplied
Warner Losh (7):
Use sys/ioctl.h to pull in definitions.
Remove unnecessary asm/byteorder.h
Remove unnecessary linux/types.h include.
Include libgen.h for basename prototype.
Include sys/stat.h
nvme-cli: remove endian.h
nvme-cli: fix ioctl argument
Warner.Losh (1):
We don't need to include linux/types.h here.
Yi Zhang (1):
nvme-cli: print "\n" after nvme list-subsys -o json
beomsooo.kim (1):
In json output, if the commands add zero length string, it occur allocation fail & abort (cannot display empty value)
chrono (1):
Added gentoo to README.md
freezer5 (2):
Fix printing of large ANAGRPID values
Fix printing of large ANAGRPID values
jaredeh (1):
timeout option added to ns_create/delete (#440)
lijie (2):
nvme-cli:fix a typo in SELF-TEST log
nvme-cli: fix a typo
puneet kandhari (1):
Remove trailing "\n" so that the output is valid json
Signed-off-by: Keith Busch <keith.busch@intel.com>