Page MenuHomeFreeBSD

Generic cmd parsing
ClosedPublic

Authored by imp on Feb 22 2019, 4:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 22, 2:28 PM
Unknown Object (File)
Fri, Dec 20, 10:44 AM
Unknown Object (File)
Nov 3 2024, 1:08 PM
Unknown Object (File)
Nov 3 2024, 1:07 PM
Unknown Object (File)
Nov 3 2024, 1:07 PM
Unknown Object (File)
Nov 3 2024, 1:07 PM
Unknown Object (File)
Nov 3 2024, 1:05 PM
Unknown Object (File)
Nov 3 2024, 1:05 PM
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 22804
Build 21895: 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.