Johannes Thumshirn [Tue, 10 Apr 2018 08:51:10 +0000 (10:51 +0200)]
Documentation: add manpage entry for connect's --ctrl-loss-tmo setting
When adding nvme connect's --ctrl-loss-tmo flag we forgot to update
the manpage accordingly.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reported-by: Matt Schulte <matt.schulte@netapp.com> Signed-off-by: Keith Busch <keith.busch@intel.com>
Keith Busch [Wed, 4 Apr 2018 14:14:26 +0000 (08:14 -0600)]
Remove error print for telemetry log arg parse
We don't want to see an error message if the '--help' option was
utilized. Parsing errors are also already printed, so don't need the
second error message anyway.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Rodrigo R. Galvao [Tue, 20 Mar 2018 19:10:46 +0000 (16:10 -0300)]
nvme-cli: Add friendly status messages
Additional messages were added on nvme_status_to_string(), in
order to make the returned status easier to understand.
The messages were based in the Description of those statuses in
the NVMe Specification (v1.3), from the figures 31-36.
Signed-off-by: Rodrigo R. Galvao <rosattig@linux.vnet.ibm.com>
Keith Busch [Mon, 19 Mar 2018 22:55:34 +0000 (16:55 -0600)]
get-log: Make log identifier a required parameter
If you're using the generic get-log, make sure the user specifies the
log parameter. It would be a user error if they don't as they should
never be counting on a default parameter.
Vijay Kumar [Wed, 7 Mar 2018 01:24:12 +0000 (18:24 -0700)]
Log error incase of failure in get_nvme_subsystem_info()
Currently get_nvme_subsystem_info() silently fails in case
of error. This patch logs relevant error message incase of
failure in get_nvme_subsystem_info().
Vijay Kumar [Wed, 7 Mar 2018 01:45:34 +0000 (19:45 -0600)]
Fix double free in list_subsys
get_nvme_subsystem_info() deallocates subsys_list_item in case of error.
This hits double free when list_subsys() as well attempts to free it.
Removed deallocation of subsys_list_item from get_nvme_subsystem_info().
Keith Busch [Mon, 12 Feb 2018 15:03:26 +0000 (08:03 -0700)]
Fix freeing wrong address
We increment the pointer for the firmware buffer as we read it, so we
can't free that value. This patch saves the original address so it may
be freed later.
Jeff Lien [Mon, 5 Feb 2018 16:35:59 +0000 (10:35 -0600)]
NVMe-CLI Fix fw_log Command json output
Currently, the json output for the fw_log command slot number
is zero based while the normal output is one based. This patch
will change the json output to one based. It will also only
print the revisions for the valid slots.
Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
[fixed whitespace formatting] Signed-off-by: Keith Busch <keith.busch@intel.com>
Minwoo Im [Tue, 30 Jan 2018 10:36:49 +0000 (19:36 +0900)]
nvme-cli: update documentations to sync up with subcommands
Update all documentations to sync up with built-in plugin subcommands.
Not only options supported by subcommands, But few descriptions have not
been updated with implementations.
Sync-up documentation with subcommands implementations.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Tue, 30 Jan 2018 10:11:42 +0000 (19:11 +0900)]
nvme-cli: convert iekey into a no_argument parameter
IEKEY(Ignore Existing Key) option is used widely in Reservation Acquire,
Reservation Register, and Reservation Release in a type of bool(1-bit).
Only resv_release() uses iekey field as a required_argument parameter.
It seems unnecessary because it will not be checked if this parameter
is given or not by a following condition because default value is 0.
if (cfg.iekey > 1)
So remove unnecessary if-statement and convert this field to a
no_argument type option.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Tue, 30 Jan 2018 10:10:27 +0000 (19:10 +0900)]
nvme-cli: make return negative value in nvme_get_nsid() when not blkdev
If caller invokes get_nsid() with character device without checking
whether a given device is block device or not, ENOTBLK is returned from
nvme_get_nsid() which is a positive value, so that caller may treat this
value as a valid nsid.
Make it return a negative vaelue with -ENOTBLK and add error checking to
callers.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Fri, 26 Jan 2018 15:35:44 +0000 (00:35 +0900)]
nvme-cli: add print for command name to effects-log
Commands Supported and Effects log page describes commands supported and
effects of commands. It would be better if command names are printed out
with their opcodes.
So, Add the command names following NVMe 1.3a specification to
effects-log command to both normal mode and json mode.
Minwoo Im [Wed, 17 Jan 2018 11:29:41 +0000 (20:29 +0900)]
nvme-cli: fix memory leak in dir_receive()
Fix memory leak for _buf_.
==10014== HEAP SUMMARY:
==10014== in use at exit: 16 bytes in 1 blocks
==10014== total heap usage: 52 allocs, 51 frees, 15,638 bytes
allocated
==10014==
==10014== Searching for pointers to 1 not-freed blocks
==10014== Checked 70,656 bytes
==10014==
==10014== 16 bytes in 1 blocks are definitely lost in loss record 1 of 1
==10014== at 0x4C2FFC6: memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10014== by 0x4C300D1: posix_memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10014== by 0x402733: dir_receive (nvme.c:3531)
==10014== by 0x4192A7: handle_plugin (plugin.c:150)
==10014== by 0x401890: main (nvme.c:3825)
==10014==
==10014== LEAK SUMMARY:
==10014== definitely lost: 16 bytes in 1 blocks
==10014== indirectly lost: 0 bytes in 0 blocks
==10014== possibly lost: 0 bytes in 0 blocks
==10014== still reachable: 0 bytes in 0 blocks
==10014== suppressed: 0 bytes in 0 blocks
==10014==
==10014== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 17 Jan 2018 11:26:37 +0000 (20:26 +0900)]
nvme-cli: fix memory leak in sec_recv()
Fix memory leak for _sec_buf_.
==7670== HEAP SUMMARY:
==7670== in use at exit: 4,096 bytes in 1 blocks
==7670== total heap usage: 31 allocs, 30 frees, 8,046 bytes allocated
==7670==
==7670== Searching for pointers to 1 not-freed blocks
==7670== Checked 70,656 bytes
==7670==
==7670== 4,096 bytes in 1 blocks are definitely lost in loss record 1 of
1
==7670== at 0x4C2FFC6: memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7670== by 0x4C300D1: posix_memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7670== by 0x4056F3: sec_recv (nvme.c:3391)
==7670== by 0x419587: handle_plugin (plugin.c:150)
==7670== by 0x401890: main (nvme.c:3799)
==7670==
==7670== LEAK SUMMARY:
==7670== definitely lost: 4,096 bytes in 1 blocks
==7670== indirectly lost: 0 bytes in 0 blocks
==7670== possibly lost: 0 bytes in 0 blocks
==7670== still reachable: 0 bytes in 0 blocks
==7670== suppressed: 0 bytes in 0 blocks
==7670==
==7670== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Minwoo Im [Wed, 17 Jan 2018 11:25:14 +0000 (20:25 +0900)]
nvme-cli: fix memory leak in dir_send()
Fix memory leak for _buf_.
==9566== HEAP SUMMARY:
==9566== in use at exit: 1,024 bytes in 1 blocks
==9566== total heap usage: 52 allocs, 51 frees, 16,681 bytes allocated
==9566==
==9566== Searching for pointers to 1 not-freed blocks
==9566== Checked 70,656 bytes
==9566==
==9566== 1,024 bytes in 1 blocks are definitely lost in loss record 1 of
1
==9566== at 0x4C2FFC6: memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9566== by 0x4C300D1: posix_memalign (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9566== by 0x402174: dir_send (nvme.c:2535)
==9566== by 0x419317: handle_plugin (plugin.c:150)
==9566== by 0x401890: main (nvme.c:3818)
==9566==
==9566== LEAK SUMMARY:
==9566== definitely lost: 1,024 bytes in 1 blocks
==9566== indirectly lost: 0 bytes in 0 blocks
==9566== possibly lost: 0 bytes in 0 blocks
==9566== still reachable: 0 bytes in 0 blocks
==9566== suppressed: 0 bytes in 0 blocks
==9566==
==9566== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>