* Peter Maydell (peter.mayd...@linaro.org) wrote:
> On Tue, 11 Jun 2024 at 06:50, Markus Armbruster <arm...@redhat.com> wrote:
> >
> > Philippe Mathieu-Daudé <phi...@linaro.org> writes:
> >
> > > Officialise the QMP command, use the existing
> > > hmp_info_human_readable_text() helper.
> >
> > I'm not sure "officialise" is a word :)
> >
> > Taking a step back...  "info via" and its new QMP counterpart
> > x-query-mos6522-devices dump device state.  I understand why examining
> > device state via monitor can be useful for debugging.  However, we have
> > more than 2000 devices in the tree.  Clearly, we don't want 2000 device
> > state queries.  Not even 100.  Could we have more generic means instead?
> >
> > We could use QOM (read-only) properties to expose device state.
> >
> > If we use one QOM property per "thing", examining device state becomes
> > quite tedious.  Also, you'd have to stop the guest to get a consistent
> > view, and adding lots of QOM properties bloats the code.
> >
> > If we use a single, object-valued property for the entire state, we get
> > to define the objects in QAPI.  Differently tedious, and bloats the
> > generated code.
> 
> We already have a machine readable mandatory-for-every-device
> representation of its entire state -- it's the vmstate struct.
> Admittedly this is sometimes a bit different from the guest-facing
> view of a device and we don't machine-record the field names...

vmstate might not contain everything needed for debug; devices
do a lot of fiddling to create a consistent vmstate, and there may
be more that someone debugging wants (e.g. fd's or host memory addresses).
It's also hopelessly cryptic.

From an HMP point, a 'info debug <DEVICENAME>' seems good to me,
possibly with some options as to whether to recurse or perhaps
add flags to 'info qtree' to also call it.

Dave




> -- PMM
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

Reply via email to