History log of /freebsd-current/sbin/nvmecontrol/reset.c
Revision Date Author Comments
# 32e86a82 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sbin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 5dc463f9 12-Nov-2020 Alexander Motin <mav@FreeBSD.org>

Improve nvmecontrol error reporting.

MFC after: 1 week
Sponsored by: iXsystems, Inc.


# 8f92938f 28-Oct-2020 Alexander Motin <mav@FreeBSD.org>

Use proper variable for device path.

It seems *-passthru commands were broken from the day one, since the
device path is fetched into opt.dev variable and not left in argv[optind].
The other three wrong argv[optind] instances are just in error messages.

MFC after: 1 week
Sponsored by: iXsystems, Inc.


# 5458a1c8 20-Apr-2020 Alexander Motin <mav@FreeBSD.org>

Allow namespace-id specification where it makes sense.

It makes tool more convenient to not require user to explicitly convert
namespace device name into controller device name. There should be no
changes to already existing syntaxes.

MFC after: 1 week


# 6995fb5e 02-Apr-2020 David Bright <dab@FreeBSD.org>

Fix various Coverity-detected errors in nvmecontrol

This fixes several Coverity-detected errors in nvmecontrol. While in
here, a couple additional errors with shift/mask confusion that were
not diagnosed by Coverity are also fixed.

CIDs addressed: 1040299, 1040300, 1403972, 1403973, 1403985, 1403988,
1403990, 1404374, 1404427, 1404469, 1404510, 1404534, 1418118

CID 1403657 (resource leak of shared library handle) was marked
"intentional" in the Coverity scan database.

Reviewed by: vangyzen, robert.herndon_dell.com
Reviewed by: daniel.william.ryan_gmail.com (earlier version)
Reviewed by: rramsden_isilon.com (earlier version), imp
MFC after: 5 days
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D24203


# e843651b 30-Jul-2019 Alexander Motin <mav@FreeBSD.org>

Tune some commands desctiption.

MFC after: 2 weeks


# f634b4c1 16-Jul-2019 Warner Losh <imp@FreeBSD.org>

Create generic command / arg parsing routines

Create a set of routines and structures to hold the data for the args
for a command. Use them to generate help and to parse args. Convert
all the current commands over to the new format. "comnd" is a hat-tip
to the TOPS-20 %COMND JSYS that (very) loosely inspired much of the
subsequent command line notions in the industry, but this is far
simpler (the %COMND man page is longer than this code) and not in the
kernel... Also, it implements today's de-facto
command [verb]+ [opts]* [args]*
format rather than the old, archaic TOPS-20 command format :)

This is a snapshot of a work in progress to get the nvme passthru
stuff committed. In time it will become a private library and used
by some other programs in the tree that conform to the above pattern.

Differential Revision: https://reviews.freebsd.org/D19296


# 0d095c23 06-Dec-2018 Warner Losh <imp@FreeBSD.org>

Const poison the command interface

Make the pointers we pass into the commands const, also make the
linker set mirrors const.

Suggested by: cem@
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18459


# d4fdb249 02-Dec-2018 Warner Losh <imp@FreeBSD.org>

Usage cleanup pt 2

Eliminage redundant spaces and nvmecontrol at start of all the usage
strings. Update the usage printing code to add them back when
presenting to the user. Allow multi-line usage messages and print
proper leading spaces for lines starting with a space.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403


# 7d923c13 02-Dec-2018 Warner Losh <imp@FreeBSD.org>

Usage cleanup pt 1

Provide a usage() function that takes a struct nvme_function pointer
and produces a usage mssage. Eliminate all now-redundant usage
functions. Propigate the new argument through the program as needed.
Use common routine to print usage.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403


# a13a291a 02-Dec-2018 Warner Losh <imp@FreeBSD.org>

Move nvmecontrol to using linker sets for commands

More commands will be added to nvmecontrol. Also, there will be a few
more vendor commands (some of which may need to remain private to
companies writing them). The first step on that journey is to move to
using linker sets to dispatch commands. The next step will be using
dlopen to bring in the .so's that have the command that might need
to remain private for seamless integration.

Similar changes to this will be needed for vendor specific log pages.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D18403


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# 821ef73c 09-Jul-2013 Jim Harris <jimharris@FreeBSD.org>

Incorporate feedback from bde@ based on r252672 changes:

* Use 0/1 instead of sysexits. Man pages are confusing on this topic,
but 0/1 is sufficient for nvmecontrol.
* Use err function family where possible instead of fprintf/exit.
* Fix some typing errors.
* Clean up some error message inconsistencies.

Sponsored by: Intel
Submitted by: bde (parts of firmware.c changes)
MFC after: 3 days


# d2cdb28b 26-Jun-2013 Jim Harris <jimharris@FreeBSD.org>

Ensure that a device node is specified when invoking the identify or reset
commands.

Also improve the checking of device node names, so that better error
messages are displayed when incorrect names are specified.

Sponsored by: Intel
MFC after: 3 days


# 28c09110 26-Jun-2013 Jim Harris <jimharris@FreeBSD.org>

Break out code related to the reset command into a separate source file.

Sponsored by: Intel
MFC after: 3 days