Page MenuHomeFreeBSD

geom: Convert err/warn() to xo_err/warn() and style(9) fixes
ClosedPublic

Authored by js on Jan 29 2026, 9:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 28, 12:37 AM
Unknown Object (File)
Mon, Feb 23, 6:59 PM
Unknown Object (File)
Mon, Feb 23, 3:43 PM
Unknown Object (File)
Mon, Feb 23, 10:23 AM
Unknown Object (File)
Wed, Feb 18, 5:21 AM
Unknown Object (File)
Sat, Feb 14, 7:15 PM
Unknown Object (File)
Sat, Feb 14, 10:39 AM
Unknown Object (File)
Sat, Feb 14, 10:27 AM
Subscribers

Details

Summary

Finishing up the libxo conversion of geom by switching err(3) to their libxo equivalents.

While here, fix some style(9) issues. There are still a few left, but at least they're fewer now.

MFC: 2w

Test Plan

Somewhat tested by running some invalid commands like geom disk doesnotexist, using invalid flags to valid commands, geom union status without loading gunion and so on. I have not tested every single error, but I'm confident they will work.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

js requested review of this revision.Jan 29 2026, 9:15 AM

It looks good to me. And I see that with --libxo=json, these errors append a {}. Are there any other cases where they do something differently than err?

This revision is now accepted and ready to land.Jan 29 2026, 8:50 PM

It looks good to me. And I see that with --libxo=json, these errors append a {}. Are there any other cases where they do something differently than err?

Not that I'm aware of. As for the brackets, I don't know why libxo does that. At first I thought it was because I had opened a container too early somewhere. But I get these brackets with

geom --libxo:J -t -p union
geom: At most one of -P and -t may be specified.
{ }

that error comes from row 845 in main(). There are no open containers (or lists (or instances)) at this point. The only libxo related function calls we've done this far is xo_parse_args() and xo_set_version().

@phil Have I done something wrong or are the brackets intended?