Page MenuHomeFreeBSD

Add "geom -p".
ClosedPublic

Authored by trasz on Sep 11 2018, 2:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 3, 6:51 AM
Unknown Object (File)
Mon, Dec 2, 9:42 AM
Unknown Object (File)
Mon, Dec 2, 9:42 AM
Unknown Object (File)
Mon, Dec 2, 9:42 AM
Unknown Object (File)
Mon, Dec 2, 9:42 AM
Unknown Object (File)
Mon, Dec 2, 1:10 AM
Unknown Object (File)
Mon, Dec 2, 1:04 AM
Unknown Object (File)
Mon, Dec 2, 1:04 AM
Subscribers

Details

Summary

Add new option to geom(8) utility, "-p". It makes it easy to look up GEOM class instance from the provider name.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz retitled this revision from Add "geom -P". to Add "geom -p" and "geom -t"..Sep 11 2018, 5:08 PM
trasz edited the summary of this revision. (Show Details)
trasz added a reviewer: oshogbo.
oshogbo requested changes to this revision.Sep 11 2018, 5:37 PM

I proposed some minor changes.

sbin/geom/core/geom.8
27 ↗(On Diff #47917)

Don't forgot about it :)

sbin/geom/core/geom.c
668 ↗(On Diff #47917)

Should be return (gp);

685 ↗(On Diff #47917)

Do we want to handle negative numbers explicit here?

695 ↗(On Diff #47917)

Over 80.

697 ↗(On Diff #47917)

Over 80, should be:

show_tree_geom(mesh, gp2,
     indent + 2);
716 ↗(On Diff #47917)

Over 80.

731 ↗(On Diff #47917)

Incorrect according to the style(9).

738 ↗(On Diff #47917)

Do we need to strdup it?

757 ↗(On Diff #47917)

Missing dot at the end of the sentence.
In other cases when errx is used the dot is present.

767 ↗(On Diff #47917)

This whole part is only when gerprogname is equals to 'geom' maybe is worth doing something like geom_main?

895 ↗(On Diff #47917)

Missing dot at the end of the sentence.
In other cases when errx is used the dot is present.

This revision now requires changes to proceed.Sep 11 2018, 5:37 PM
0mp requested changes to this revision.Sep 11 2018, 7:24 PM
0mp added a subscriber: 0mp.

Also, are those standard options for valid for any *standard command*? If so then the synopsis section should look a little bit different since at the moment it suggests that the only valid uses of -p and -t are geom -t and geom -p provider-name.

sbin/geom/core/geom.8
112 ↗(On Diff #47917)

Is there a reason why it's -width ".Cm status" instead of -width "-p"?

113 ↗(On Diff #47917)

Did you mean .It Fl p Ar provider-name? The -p option expects an argument, right?

trasz edited the summary of this revision. (Show Details)

Fix issues and drop -t for the moment.

trasz added inline comments.
sbin/geom/core/geom.8
112 ↗(On Diff #47917)

It's to keep it aligned with the .Bl above.

sbin/geom/core/geom.c
685 ↗(On Diff #47917)

Let's leave the "tree" part for another review, it needs more work.

738 ↗(On Diff #47917)

I never remember. It seems to be a pretty common pattern.

767 ↗(On Diff #47917)

Nah, it's just a few lines of code. Besides it would result in a rather weird flow, since we would call geom_main() and in some cases it would return, and in others it wouldn't.

trasz retitled this revision from Add "geom -p" and "geom -t". to Add "geom -p"..
trasz edited the summary of this revision. (Show Details)
In D17116#365084, @0mp wrote:

Also, are those standard options for valid for any *standard command*? If so then the synopsis section should look a little bit different since at the moment it suggests that the only valid uses of -p and -t are geom -t and geom -p provider-name.

Those options are only to be used with geom(8), not gwhatever(8) commands nor the "standard commands" like the "list" or "load".

The manpage update looks fine.

sbin/geom/core/geom.8
112 ↗(On Diff #47917)

+1

Yes, manpage update approved by mentor, although this is not needed with a src bit. ;-)

sbin/geom/core/geom.8
27 ↗(On Diff #47917)

You are the wind beneath my wings, @oshogbo. ;-)

One minor change. Besides that LGTM.

sbin/geom/core/geom.8
27 ↗(On Diff #47917)

xD

sbin/geom/core/geom.c
702 ↗(On Diff #47948)

According to style(9) only boolean can be used like that.
Should be:
if (provider_name != NULL)

This revision was not accepted when it landed; it landed in state Needs Review.Sep 13 2018, 2:06 PM
This revision was automatically updated to reflect the committed changes.