Page MenuHomeFreeBSD

Generic cmd parsing
ClosedPublic

Authored by imp on Feb 22 2019, 4:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 23, 2:22 PM
Unknown Object (File)
Apr 29 2024, 10:03 PM
Unknown Object (File)
Apr 29 2024, 9:38 PM
Unknown Object (File)
Apr 29 2024, 6:12 PM
Unknown Object (File)
Apr 29 2024, 8:41 AM
Unknown Object (File)
Apr 29 2024, 8:39 AM
Unknown Object (File)
Apr 29 2024, 5:12 AM
Unknown Object (File)
Apr 26 2024, 7:56 AM
Subscribers

Details

Summary

This is a preview commit with a terrible commit message.

rework to include descriptions and arg info

Generic argument parsing and usage generation, first pass

Convert devlist to new arg parsing routines.

Implement {io,admin}-passthru commands. (this is a separate commit)

These are mostly compatible with Linux, with three exceptions.

  1. We don't do metadata segment stuff. Our passthrough interface doesn't cope. The code is there, but generates an error.
  2. Linux lets you specify a namespace ID for the command. We current do not: we get ours from the namespace device, or pass in a generic one. Generally, this will lead to the same command, but FreeBSD's is safer since you can't specify the wrong id.
  3. --show-command outputs to stderr instead of stdout so you can both see your command, and capture its output with a simple redirect.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23452
Build 22465: arc lint + arc unit

Event Timeline

sbin/nvmecontrol/passthru.c
139

Fixed up already...

nvmecontrol now compiles

It compiles now. Fixed a few bugs that have come up in testing,
especially with shortopts.

Update after latest cleanups.

still not quite there yet. need to do top-to-bottom reivew now that
I've plumbed comnd end-to-end.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 16 2019, 5:24 PM
This revision was automatically updated to reflect the committed changes.