Skip to content

global command line options#3094

Merged
igaw merged 6 commits intolinux-nvme:masterfrom
igaw:disable-ioctl-probing
Feb 13, 2026
Merged

global command line options#3094
igaw merged 6 commits intolinux-nvme:masterfrom
igaw:disable-ioctl-probing

Conversation

@igaw
Copy link
Collaborator

@igaw igaw commented Feb 12, 2026

We have defined a set of global command options but not all commands us it. Make NVME_OPTS a bit more unusable and replace OPT_ARGS with it.

This change is based after realizing that the global command options are not so global after all, when introducing the --no-ioctl-probing knob.

See also: linux-blktests/blktests#224 (comment)

Replace the outdated dbhi/qus/action@mainwith a more current alternative
for QEMU user-mode emulation setup.

Signed-off-by: Daniel Wagner <[email protected]>
@igaw igaw force-pushed the disable-ioctl-probing branch 3 times, most recently from 459574e to dd5b97e Compare February 12, 2026 17:59
igaw added 4 commits February 12, 2026 18:59
blktests nvme/039 is assuming that the first ioctl issued is the
expected IO passthru. Though the recent introduce ioctl probing breaks
the tests. One could argue that the test should be made more robust but
it's probably a good idea to have a way to disable this feature anyway.

The obvious to way to implement this feature is to add a flag argument
to nvme_open. This works for all nvme commands but not for the nvmf
because under the hood new transport handles are created when necessary.
Since this is a global flag anyway, add it to the global context.

Signed-off-by: Daniel Wagner <[email protected]>
Use the nvmf prefix for the common fabrics command line arguments,
instead the fabrics prefix.

Signed-off-by: Daniel Wagner <[email protected]>
Use the same naming scheme as in fabrics, where the common command line
argumnent struct is called nvmf_args.

Signed-off-by: Daniel Wagner <[email protected]>
Let NVMF_ARGS use NVME_ARGS, so that the common default comamnd line
arguments are also present for the fabrics commands.

Signed-off-by: Daniel Wagner <[email protected]>
@igaw igaw force-pushed the disable-ioctl-probing branch 4 times, most recently from 995cb12 to c748875 Compare February 12, 2026 18:39
@igaw igaw requested a review from Copilot February 12, 2026 18:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the nvme-cli codebase to consolidate global command-line options (verbose, output-format, timeout, etc.) into a unified NVME_ARGS macro and nvme_args global structure. The change introduces the --no-ioctl-probing option to control 64-bit IOCTL support probing and replaces OPT_ARGS with NVME_ARGS across most plugin commands.

Changes:

  • Renamed nvme_config struct to nvme_args and added no_ioctl_probing field
  • Replaced OPT_ARGS with NVME_ARGS macro across all plugin commands that use parse_and_open()
  • Removed local output_format, verbose, and timeout fields from command-specific config structs
  • Added nvme_set_ioctl_probing() function to libnvme to control IOCTL probing behavior
  • Updated parse_and_open() to handle the new --no-ioctl-probing option

Reviewed changes

Copilot reviewed 54 out of 54 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
nvme.h Renamed nvme_config to nvme_args, added no_ioctl_probing field, updated NVME_ARGS macro
nvme.c Updated all references from nvme_cfg to nvme_args, added ioctl probing logic
nvme-print.c Updated dry_run reference to use nvme_args
nvme-print-json.c Updated output_format_ver references to use nvme_args
nvme-rpmb.c Replaced OPT_ARGS with NVME_ARGS
logging.c Updated references to use nvme_args
fabrics.c Renamed fabric_args to nvmf_args, replaced OPT_ARGS with NVME_ARGS, removed local verbose fields
libnvme/src/nvme/tree.c Initialize ioctl_probing to true in nvme_create_global_ctx
libnvme/src/nvme/private.h Added ioctl_probing field to nvme_global_ctx
libnvme/src/nvme/linux.h Added nvme_set_ioctl_probing() function declaration
libnvme/src/nvme/linux.c Implemented nvme_set_ioctl_probing() and conditional probing logic
libnvme/src/libnvme.ld Exported nvme_set_ioctl_probing symbol
plugins//.c Replaced OPT_ARGS with NVME_ARGS, removed local output_format/verbose/timeout fields, updated to use nvme_args.*
.github/workflows/build.yml Updated QEMU action from dbhi/qus to docker/setup-qemu-action@v3

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@igaw igaw force-pushed the disable-ioctl-probing branch from c748875 to 5385b8b Compare February 12, 2026 18:47
The global command lines arguments should be used for every command, so
that we have a consistent user experience.

Signed-off-by: Daniel Wagner <[email protected]>
@igaw igaw force-pushed the disable-ioctl-probing branch from 5385b8b to 8c54b55 Compare February 12, 2026 18:49
@igaw igaw merged commit abe29d0 into linux-nvme:master Feb 13, 2026
19 of 20 checks passed
@igaw igaw deleted the disable-ioctl-probing branch February 13, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant