Page MenuHomeFreeBSD

stand: parsedev API change: devspec now points to start of full device name
ClosedPublic

Authored by imp on Nov 29 2022, 9:16 PM.
Tags
None
Referenced Files
F81926898: D37553.diff
Tue, Apr 23, 7:28 AM
Unknown Object (File)
Sun, Apr 21, 11:15 PM
Unknown Object (File)
Feb 18 2024, 10:40 PM
Unknown Object (File)
Feb 18 2024, 10:36 PM
Unknown Object (File)
Feb 18 2024, 7:37 PM
Unknown Object (File)
Feb 18 2024, 7:25 PM
Unknown Object (File)
Jan 12 2024, 11:42 PM
Unknown Object (File)
Dec 20 2023, 7:56 AM
Subscribers

Details

Summary

To support more flexible device matching, we now pass in the full
devspec to the parsedev routines. For everything execpt uboot, this is
just a drop in (since everything except uboot and openfirmware always
uses disk...: and/or zfs:, but openfirmware isn't really affected).

uboot we kludge around it by subtracting 4 from where the rest of the
device name starts. This is unforunate, and can compute the address one
before the string. But we never dereference that address. uboot needs
more work, and this is an acceptable UB until that other work happens.

OFW doesn't really use the parsedev routines these days (since none of
the supported device uses this... yet). It too needs more work, but it
needs device matching support first.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 48554
Build 45440: arc lint + arc unit

Event Timeline

imp requested review of this revision.Nov 29 2022, 9:16 PM

I think the code is fine as-is.

<nitpick>Have you considered splitting disk_parsedev into two routines, like disk_parsedev (to be called by regular callers and with the 'disk' prefix) and disk_parsedev2 (which is called by callers including disk_parsedev who knows to skip the 'disk' prefix) to avoid the hack? As an added benefit the callee (also zfs_parsedev) could validate that caller is passing the proper prefix when boot code is built with diagnostics enabled.</nitpick>

This revision is now accepted and ready to land.Nov 30 2022, 6:30 AM