Page MenuHomeFreeBSD

gmultipath: new command "gmultipath which"
Needs ReviewPublic

Authored by guest-jsollvander on Nov 8 2022, 5:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 7, 6:26 PM
Unknown Object (File)
Sun, Mar 31, 10:24 AM
Unknown Object (File)
Feb 29 2024, 12:48 PM
Unknown Object (File)
Dec 23 2023, 2:20 AM
Unknown Object (File)
Dec 20 2023, 4:39 PM
Unknown Object (File)
Dec 13 2023, 10:38 AM
Unknown Object (File)
Dec 13 2023, 4:55 AM
Unknown Object (File)
Nov 17 2023, 4:57 PM
Subscribers

Details

Reviewers
mav
asomers
Summary

Print which multipath device this provider/path is used by.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Not that I have specific objections against this, but I think it would be much better to implement a generic way to print all consumers connected to specified GEOM provider. This code does not look anyhow specific to gmultipath.

In D37309#847728, @mav wrote:

Not that I have specific objections against this, but I think it would be much better to implement a generic way to print all consumers connected to specified GEOM provider. This code does not look anyhow specific to gmultipath.

Maybe something like "geom -c <consumer-name>" to complement the existing "geom -p <provider-name>"?

Maybe something like "geom -c <consumer-name>" to complement the existing "geom -p <provider-name>"?

Consumers don't have personal names in GEOM, only names of connected provider. Plus there can be many consumers connected to the same provider. But I like the direction of thought. Or it should not be difficult to add another sub-command.

In D37309#847728, @mav wrote:

Not that I have specific objections against this, but I think it would be much better to implement a generic way to print all consumers connected to specified GEOM provider. This code does not look anyhow specific to gmultipath.

Adding a consumer/brief flag to "geom -p <provider>" so it just prints consumers would be really nice actually. I could look into adding that as well.

So I experimented a little and remade this as "geom -c <consumer>". But unless I figure out a good way to filter by class it is useless. Right now it will just pick whatever class the provider first appears in, like DEV. So the proper way, IMO, to do that would be "geom <class> which <consumer>" and not just add another flag. But then "which" would only exist when using "geom" directly and not when using "gmultipath"/"gpart"/"glabel" binaries which I think would look weird. What are your thoughts?