Skip to content

plugins/exclusion: operate on the default list when --name is omitted#3540

Merged
igaw merged 1 commit into
linux-nvme:masterfrom
martin-belanger:exclusion-default-list
Jul 3, 2026
Merged

plugins/exclusion: operate on the default list when --name is omitted#3540
igaw merged 1 commit into
linux-nvme:masterfrom
martin-belanger:exclusion-default-list

Conversation

@martin-belanger

Copy link
Copy Markdown

Bug fix for the nvme exclusion CLI (merged in #3523). The library treats a NULL list name as the default list (/etc/nvme/exclusions.conf — the one nvme disconnect --exclude writes to), but every mutating nvme exclusion subcommand rejected a missing --name, so the CLI could not manage the most commonly written list at all: the only ways to touch it were disconnect --exclude or a hand edit.

--name is now optional on create, delete, add, remove and edit; omitting it targets the default list. The help texts and the five man pages say so, and the synopsis shows the option as optional.

Also fixes a misleading error: an invalid list name was reported as invalid entry (unknown key): <entry>, pointing the user at a perfectly valid entry. The entry is now validated first (invalid entry: …) and a remaining -EINVAL is attributed to the name (invalid list name: …).

New unit tests cover the NULL-name operations end to end (create/add/match/remove/delete on the default list), alongside the existing exclusion suite. All tests green on glibc and musl.

The library treats a NULL list name as the default list
(/etc/nvme/exclusions.conf) -- the list nvme disconnect --exclude
writes to -- but every mutating exclusion subcommand rejected a missing
--name, so the CLI could not manage the most commonly written list at
all.

Make --name optional on create, delete, add, remove and edit; omitting
it targets the default list.  Also stop reporting a bad list name as
"invalid entry": validate the entry first and attribute a remaining
-EINVAL to the name.

Add unit tests covering the NULL-name (default list) operations.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
@igaw igaw merged commit 2a7c1bb into linux-nvme:master Jul 3, 2026
32 of 33 checks passed
@igaw

igaw commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

This what I was trying to figure out yesterday in the chat, how we handle the defaults. Thanks for making it a nice user experience!

@martin-belanger martin-belanger deleted the exclusion-default-list branch July 3, 2026 09:29
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.

2 participants