Keith Busch [Tue, 7 Jun 2016 23:02:51 +0000 (17:02 -0600)]
Move program execution to plugin handler
The command list definition is moved to a header file that generates the
structures and prototypes when compiled. This makes it easy to define
new extensions that are not part of the NVMe standard.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Thu, 2 Jun 2016 22:08:31 +0000 (16:08 -0600)]
Seperate kernel uapi from user structures
This pulls in the latest kernel's exported uapi. Including it here
so that it can be used when the kernel headers are either outdated or
not installed.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Wed, 8 Jun 2016 15:59:41 +0000 (09:59 -0600)]
Use pattern rule for compiling objects
All the object files had the same pattern, though some of the targets
were missing the correct dependency list. This fixes them all with a
pattern rule.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Tue, 7 Jun 2016 22:26:56 +0000 (16:26 -0600)]
Move parsing to top directory
We've diverged significantly from the argconfig program that nvme-cli
inherited, so no point in trying to keep it separate. Move it to the
top-level directory to make build rules easier.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Christoph Hellwig [Tue, 7 Jun 2016 15:19:27 +0000 (17:19 +0200)]
implement the connect-all command
Connects to all controllers pointed to by the discovery service.
Includes following referrals.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Ming Lin <ming.l@samsung.com> Tested-by: Ming Lin <ming.l@samsung.com>
Colin Ian King [Fri, 3 Jun 2016 18:27:52 +0000 (19:27 +0100)]
Fix leak of mbuffer on error exit path
building with clang scan-build picked up a memory leak:
nvme.c:2176:3: warning: Potential leak of memory pointed to by 'mbuffer'
fprintf(stderr, "failed to read data buffer from input file\n");
^~~~~~~
instead of returning, jump to free_and_return which performs the
correct cleanup. Also fix the indentation of the return at the end of
the function.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Colin Ian King [Thu, 2 Jun 2016 18:25:54 +0000 (19:25 +0100)]
Fix null pointer dereference on strlen()
If string is NULL, then the proceeding strlen() on the string
will lead to a NULL pointer dereference error (segmentation fault).
Fix this by swapping the order of the comparisons, first check for
a NULL pointer; if that's not true then do the strlen check.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Matias Bjørling [Tue, 24 May 2016 15:35:34 +0000 (17:35 +0200)]
Add support for updating the bad block table
Introduce lnvm-diag-set-bbtbl. It takes the channel, lun, plane, block
and the value to update and sends it to the device. Afterwards, the
status can be retrieved with lnvm-diag-get-bbtbl.
Matias Bjørling [Mon, 23 May 2016 12:44:00 +0000 (14:44 +0200)]
Add LightNVM adminstration and diagnose support
Add support for identify geometry, get bad block interface and
administration interface for LightNVM. This patch adds the following
commands:
- (lnvm-id-ns) Identify geometry of a LightNVM device.
- (lnvm-diag-bbtbl) Retrieve bad block table from LightNVM device.
- (lnvm-info) Get information about modules loaded, and available
devices.
- (lnvm-init) Initialize LightNVM device with a media manager.
- (lnvm-create) Create targets on top of registered devices.
- (lnvm-remove) Remove a registered target.
- (lnvm-factory) Factory initialize a LightNVM device.
Johannes Thumshirn [Wed, 1 Jun 2016 10:12:59 +0000 (12:12 +0200)]
bash completion: Remove shebang line
Remove shebang line from bash completion file as rpmlint on openSUSE/SLE
complains about a script ment to be sourced not executed containing a shebang
line.
[ 38s] nvme-cli.x86_64: W: sourced-script-with-shebang /etc/bash_completion.d/nvme /usr/bin/env
[ 38s] This text file contains a shebang, but is meant to be sourced, not executed.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Keith Busch [Mon, 23 May 2016 19:52:45 +0000 (13:52 -0600)]
Release v0.7
Just a few minor updates and documentation fixes. There is also a new
option for passthrough commands that can be used to help detect data
over/under run.
Tagging a stable release so we can consider features that bring in other
transports and third party extensions.
Signed-off-by: Keith Busch <keith.busch@intel.com>
The data_size and metadata_size fields in the config struct are declared as
__u32, but should actually be __u64. The current types cause issues in the
argument parsing functions depending on machine architecture and endianness. In
ppc64, using __u32 causes "data size not provided" errors due to the way writes
are being done by argconfig_parse() at src/argconfig.c. Changing the types to
__u64 should fix this behaviour and is in accordance to the CFG_LONG_SUFFIX
flag.
Signed-off-by: Heitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
seehearfeel [Sat, 26 Mar 2016 13:14:43 +0000 (21:14 +0800)]
Fix the bug of Model Number and display the info of Serial Number
OK, I see, thanks for your suggestion.
I have modified the related code of Serial Number, Model Number and Firmware Revision,
other fields are not be changed because the length can not be properly figured out by
the print format specifier, (int)sizeof(field) is too big and (int)strlen(field) is random.
In addition, fix a minor spelling mistake "Namepace" to "Namespace".
seehearfeel [Tue, 22 Mar 2016 11:23:15 +0000 (19:23 +0800)]
Fix the bug of Model Number and display the info of Serial Number
According to the NVMe Specification, there is an error when display Model Number.
In addition, currently it does not display the info of Serial Number, so add it.
Keith Busch [Thu, 3 Mar 2016 20:20:16 +0000 (13:20 -0700)]
Simplify show-regs
You only need to specify the name of the device. The character or block
device was never necessary to show the registers since we're opening the
sysfs resource entry. This is backwards compatibles with the old way as
the basename was stripped from the path before.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Thu, 3 Mar 2016 20:11:52 +0000 (13:11 -0700)]
Simplify non-argument params
The device is the first non-argument param. The handling for this is
done by argparse, and we expect to move it to the end. Instead, it'd be
easier to let getopt's handle this by not providing the '-' signifier
to treat non-arguments as arguments. This simplifies opening the device.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Thu, 3 Mar 2016 14:32:18 +0000 (07:32 -0700)]
Fixing a get and set features
The get feature argument for extensive decoding for readibility is 'H'
rather than 'h', and a set feature value can be 0xffffffff, so fixing
that bogus check.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Wed, 2 Mar 2016 23:59:18 +0000 (16:59 -0700)]
Misc fixes
A few errors in the moving occured. The short non-option arguments
weren't working, gnu parse option parameters were mishandled, and get
features used the wrong opcode.
Folding in help text updates.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Breno Leitao [Wed, 2 Mar 2016 21:13:16 +0000 (16:13 -0500)]
Fix English typos only
This is a commit to fix a type across the project, from "identifer" to
"identifier".
The motivation behind this fix is to make this package perfect to be
included in the Debian project. As it is, the lintian checker is
complainging about these typos using the tag spelling-error-in-manpage.