[Review] pciconf converted to use libxo [D1206]

Stefan Esser se at freebsd.org
Wed Dec 3 12:51:23 UTC 2014


Hi all,

the following review URL shows my proposed changes to make pciconf
optionally output XML or JSON formatted data via libxo:

	https://reviews.freebsd.org/D1206

I wanted to see how much effort the conversion of a utility that
was not written with libxo in mind makes - and I'm pleased by the
possibility to mostly mechanically replace printf/err/warn calls
with their libxo counterparts.

The documentation of libxo seems incomplete (e.g. no mention of
xo_error() that I could find), and some functions do not seem to
produce the expected result (xo_err() prints the message as given
in the format string, but does not automatically append strerror()
as err() does ...).

A FreeBSD man-page that lists all functions and that can be used
as a reference when libxo principles are already known would be
really great. ;-)


Since the behaviour of pciconf has not changed unless invoked with
"--libxo", I could check in this version without worrying about a
violation of POLA.

But I thought I might learn how to use Phabricator and offer an
opportunity to comment on proposed XML/JSON tags or my general
use of libxo features ...


Please let me know whether these is something wrong in the XML or
JSON output (bad tags names, bad use of xo_ functions to generate
the output, ...).

The HTML-Output looks ugly if directly viewed in a web browser,
but that's not different than what other utilities converted to
use libxo produce ...

Regards, STefan


More information about the freebsd-hackers mailing list