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.
Keith Busch [Wed, 2 Mar 2016 00:07:18 +0000 (17:07 -0700)]
Simplify argument parsing
This combines short and long option names into the same argument entry
so we don't need to duplicate each entry. This also greatly simplifies
the help printing, which had an undocumented dependency of argument
ordering just to print correctly.
The simpler setup makes it easier to add new commands.
Signed-off-by: Keith Busch <keith.busch@intel.com>
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.
It was also requested by a Debian maintainer in the following review:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810033#38
Florian Heigl [Sun, 7 Feb 2016 13:47:26 +0000 (14:47 +0100)]
Add starter doc for AlpineLinux
I've included two command examples, i hope that's not too much bloat. normally people will try to avoid using udev, but it's not really necessary either assuming everyone can ls /dev/nvme* ;)
Lakshmi Narayanand [Thu, 21 Jan 2016 15:05:46 +0000 (08:05 -0700)]
Memory Leak Fix at nvme_passthru
In nvme_passthru buffers "data and metadata" allocated are not getting
freed at the fail cases and hence might lead to memory leak. This patch
free the buffer before the return of the function.
[Fixed tab formatting and conditional braces] Signed-off-by: Keith Busch <keith.busch@intel.com>
Breno Leitao [Thu, 7 Jan 2016 18:01:06 +0000 (13:01 -0500)]
Do not ignore debian/changelog
Changelog is required in order to build the package. As this project
keeps the debian scripts in the upstream source, changelog file is
one of the most important files to be kept here.
Breno Leitao [Thu, 7 Jan 2016 17:39:00 +0000 (12:39 -0500)]
Fix debian copyright file to map Debp5
The debian/copyright file must be machine-interpretable, yet human-readable,
while communicating all mandated upstream information, copyright notices and
licensing details.
This new format maps to DEBP5, as specified at
http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Breno Leitao [Thu, 7 Jan 2016 17:36:50 +0000 (12:36 -0500)]
Add debian watch file
The file named watch in the debian directory is used to check for newer
versions of upstream software is available and to download it if necessary. The
download itself will be performed with the uscan program from the devscripts
package.
Stephen Bates [Thu, 24 Dec 2015 17:00:34 +0000 (10:00 -0700)]
Fixed changelog for Ubuntu PPAs
The changelog generated in the nvme-cli Makefile was not generic
enough for PPAs which build for multiple versions of Ubuntu. This is
controlled via the NVME_DPKG_VERSION variable that can be passed into
the Makefile.
Walter Doekes [Wed, 16 Dec 2015 14:08:11 +0000 (15:08 +0100)]
Don't cast pointers, cast values.
The compiler rightly warned about an issue in ed3848130, but the fix was
wrong.
There is no guarantee that an int is exactly 32 bits and no guarantee
that a long long is exactly 64 bits. The former one is guaranteed to be
at least 16 bits (but we can safely assume 32 for non-ancient machines).
Imagine an u32 array:
0... 1... 2... 3... 4... 5...
Now cast the pointer to the zeroth element to a 64-bits-int-pointer;
64bit sized int are quite common.
0....... 1....... 2.......
Writing to 0, 1 and 2 would put values in 0, 2 and 4 (on little endian).
And if there is enough data, it would overwrite the stack.
This change moves the casting to the point where the individual values
are copied. That's safe.
Stephen Bates [Tue, 15 Dec 2015 16:19:35 +0000 (09:19 -0700)]
Added ubuntu PPA make target.
As we move toward deploying nvme-cli (aka nvme-utils) via the ubuntu
distro we need a make target that builds the correct sources for a
PPA. For now this is a presonal PPA and can be tracked at:
https://launchpad.net/~sbates/+archive/ubuntu/ppa
Here we refactor the changelog creation and add a new make target
(deb-ppa).
Wen Xiong [Mon, 14 Dec 2015 19:12:53 +0000 (13:12 -0600)]
Subject: compilation issue on ppc.
We saw the following compilation issue on ppc.
[root@everest-lp2 nvme-cli]# make
cc -I ./src -D_GNU_SOURCE -std=gnu99 -O2 -g -Wall -Werror
-DNVME_VERSION='"0.2.15.gc4c2"' nvme.c -o nvme argconfig. o
suffix.o common.o
nvme.c: In function âmânvme.c:2227:2: error: passing argument 2 of
âgconfig_parse_comma_sep_array_longârom incompatible pointer type [-
Werror]
ns = argconfig_parse_comma_sep_array_long(cfg.slbas, slbas, 256);
^
In file included from nvme.c:52:0:
src/argconfig.h:106:10: note: expected âng long unsigned int *âut
argument is of type âu64 *âunsigned
argconfig_parse_comma_sep_array_long(char *string, unsigned long long
*ret,
^
cc1: all warnings being treated as errors
make: *** [nvme] Error 1
keithbusch [Tue, 8 Dec 2015 23:01:52 +0000 (16:01 -0700)]
Merge pull request #41 from samiWaheed/master
Added decoding of temp sensors to the SMART log page (02h)
Thanks for the fix. I did not catch that a previous commit did lot more than just _move_ the printing functions to a common library, creating this regression.
Sami Waheed [Tue, 8 Dec 2015 22:51:24 +0000 (14:51 -0800)]
Added decoding of temp sensors to the SMART log page (02h)
- Display temperature sensors data using smart-log command
- Removed code that truncated the last byte of fr, mn, sn in id-ctrl.
Matched string format with list command
Walter Doekes [Fri, 4 Dec 2015 13:41:39 +0000 (14:41 +0100)]
Improve debian package build process.
* The changes from 3686759 make the debian/rules a lot simpler.
* Fix so ld doesn't leave a.out turds.
* Add dist-orig make target that creates a reproducible orig.tar.gz.
A reproducible source archive is a first step towards reproducible
builds.
* Fix typo in debian package description.
* Add dist and pkg to the PHONY targets.
Patrick McCormick [Thu, 3 Dec 2015 17:56:22 +0000 (12:56 -0500)]
Makefile cleanup.
Don't link with unused libs: -lm, -lpthread
Don't hardcode in 64 bit compile, this will break cross compilation
Put preprocessor flags in CPPFLAGS
Add to existing variables instead of var = $var pattern
Signed-off-by: Patrick McCormick <patrick.m.mccormick@intel.com>