From: Anthony Liguori <anthony@codemonkey.ws>
To: Markus Armbruster <armbru@redhat.com>
Cc: amit.shah@redhat.com, Gerd Hoffmann <kraxel@redhat.com>,
Brad Hards <bradh@frogmouth.net>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qdev device documentation (Re: [PATCH 0/2] usb-linux: physical port handling.)
Date: Fri, 13 May 2011 09:29:12 -0500 [thread overview]
Message-ID: <4DCD4038.5080009@codemonkey.ws> (raw)
In-Reply-To: <m3zkmryrvx.fsf@blackfin.pond.sub.org>
On 05/13/2011 02:35 AM, Markus Armbruster wrote:
>> That's fine. But what better way to ensure a consistent and stable UI
>> than having it centralized in one place.
>
> Consistent, stable, and bit-rotten. Unless you come up with a way to
> catch bit-rot immediately. That means on "make", not on "make docs".
How about make check?
See the latest patch. Here is the output from a bad doc file:
Warning: device `virtio-9p-pci' is undocumented
Warning: device `virtio-balloon-pci' is undocumented
Warning: device `virtio-serial-pci' is undocumented
Warning: device `virtio-net-pci' is undocumented
Warning: device `virtio-blk-pci' is undocumented
[ .. snip .. ]
Warning: device `x3130-upstream' is undocumented
Warning: device `xio3130-downstream' is undocumented
Error: device `isa-serial' has documented property `bad-property' with
no definition
Warning: device `isa-parallel' is undocumented
Warning: device `isa-pit' is undocumented
[ .. snip .. ]
Warning: device `i440FX-xen' is undocumented
Warning: device `i440FX' is undocumented
Warning: device `i440FX-pcihost' is undocumented
Warning: device `vmport' is undocumented
Warning: device `ib700' is undocumented
Warning: device `isa-debugcon' is undocumented
Error: documented device `BadDevice' has no definition
91 warnings, 2 errors.
> Extra points if the error message points right to the offending source
> line.
Would need some macro magic in the qdev registration functions. It's
not outside the realm of possibility.
>> qdev properties are part of our UI
>> and need to be stable.
>
> Presenting them all to the user in a single document makes sense.
> Doesn't follow we have to *write* the documentation in a single place.
>
> Keeping property documentation in one place makes it soemwhat easier to
> keep the properties consistent with each other across devices.
>
> Property documentation next the device code implementing them makes it
> easier to keep the documentation consistent with reality. It also
> serves as code documentation.
>
> It's a trade off. I prefer property documentation next to the code. To
> really get consistency across devices, you have to read the resulting
> user document, anyway.
I see this evolving. To me, this is the start of a qdev schema from
which we can generate factory interfaces to each qdev device.
>> Just like we express our command line options centrally (with
>> documentation) via qemu-options.hx, it seems reasonable to me to do it
>> for qdev properties.
>>
>> I think the only downside is that we have to duplicate this the
>> current DeviceInfo definitions but that's a harder problem that can be
>> deferred for another day.
>
> Having to code stuff twice, once in C and once in JSON, is a pretty ugly
> downside.
At least I didn't submit it using XML ;-)
Regards,
Anthony Liguori
> JSON is a fine data interchange format for programs, but neither a
> programming language, nor a document markup language.
>
> [...]
>
next prev parent reply other threads:[~2011-05-13 14:29 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-10 10:30 [Qemu-devel] [PATCH 0/2] usb-linux: physical port handling Gerd Hoffmann
2011-05-10 10:30 ` [Qemu-devel] [PATCH 1/2] usb-linux: fix device path aka " Gerd Hoffmann
2011-05-11 8:52 ` Markus Armbruster
2011-05-12 9:17 ` Gerd Hoffmann
2011-05-10 10:30 ` [Qemu-devel] [PATCH 2/2] usb-linux: add hostport property Gerd Hoffmann
2011-05-10 14:24 ` [Qemu-devel] [PATCH 0/2] usb-linux: physical port handling Brad Hards
2011-05-12 9:25 ` [Qemu-devel] qdev device documentation (Re: [PATCH 0/2] usb-linux: physical port handling.) Gerd Hoffmann
2011-05-12 11:09 ` Markus Armbruster
2011-05-12 15:25 ` Gerd Hoffmann
2011-05-12 15:35 ` Anthony Liguori
2011-05-12 16:08 ` Markus Armbruster
2011-05-12 16:23 ` Anthony Liguori
2011-05-12 17:58 ` Markus Armbruster
2011-05-12 18:07 ` Anthony Liguori
2011-05-13 7:35 ` Markus Armbruster
2011-05-13 14:29 ` Anthony Liguori [this message]
2011-05-13 14:30 ` Anthony Liguori
2011-05-12 18:15 ` Peter Maydell
2011-05-12 19:32 ` Alon Levy
2011-05-12 20:08 ` Anthony Liguori
2011-05-13 7:13 ` Markus Armbruster
2011-05-12 15:56 ` Markus Armbruster
2011-05-12 16:05 ` Anthony Liguori
2011-05-12 15:58 ` Anthony Liguori
2011-05-12 16:18 ` Markus Armbruster
2011-05-12 16:25 ` Anthony Liguori
2011-05-12 18:00 ` Markus Armbruster
2011-05-12 17:21 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DCD4038.5080009@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=amit.shah@redhat.com \
--cc=armbru@redhat.com \
--cc=bradh@frogmouth.net \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).