Skip to content

Conversation

@ikegami-t
Copy link
Contributor

The shorthand -o change for --output from --opcode before. Then the default opcode value zero used incorrectly if the -o used.

if (err)
return err;

if (!argconfig_parse_seen(opts, "opcode")) {
Copy link
Collaborator

@igaw igaw Apr 30, 2025

Choose a reason for hiding this comment

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

As far I can tell, this was not enforced before, it would be a behavior change. @jk-ozlabs

Also the documentation doesn't say it's mandatory.

But I see why you added it. The help says: "opcode (required)".

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm fine with the requirement; a default opcode of 0 maps to "Read NVMe-MI data structure", and it would be a bit odd to be relying on that as an implicit command to issue.

I would agree with adding to the docs though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the documentations to add the description. (And also rebased the PR branch.) Thank you.

return err;
}

if (!argconfig_parse_seen(opts, "opcode")) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should also update the man pages. They don't mention this option is required, only the help text from above does so.

@igaw
Copy link
Collaborator

igaw commented Apr 30, 2025

Ah didn't realize I asked for this in #2103 :)

For the passthrue case it makes sense. Let's see if for nvme-mi this is also necessary.

@ikegami-t
Copy link
Contributor Author

The nvme-mi added by the PR: #1887 I created as the opcode option as required as below so looks make sense. Thank you.
https://github.com/linux-nvme/nvme-cli/blame/master/nvme.c#L10141

static int nvme_mi(int argc, char **argv, __u8 admin_opcode, const char *desc)
{
	const char *opcode = "opcode (required)";

Note: This opcode option is same with the passthrue case as required.

ikegami-t added 2 commits May 1, 2025 14:40
The shorthand -o change for --output from --opcode before.
Then the default opcode value zero used incorrectly if the -o used.

Signed-off-by: Tokunori Ikegami <[email protected]>
The opcode behavior changed as required argument.

Signed-off-by: Tokunori Ikegami <[email protected]>
@ikegami-t ikegami-t force-pushed the nvme-check-opcode branch from 922937b to db27cde Compare May 1, 2025 05:41
@igaw igaw merged commit 57ea893 into linux-nvme:master May 7, 2025
18 checks passed
@igaw
Copy link
Collaborator

igaw commented May 7, 2025

Thanks!

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.

4 participants