qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Monitor brain dump


From: Luiz Capitulino
Subject: Re: [Qemu-devel] Monitor brain dump
Date: Wed, 5 Oct 2016 13:03:17 -0400

On Wed, 05 Oct 2016 18:22:28 +0200
Markus Armbruster <address@hidden> wrote:

> In the beginning, there was only monitor.c, and it provided what we
> today call HMP, at just under 500 SLOC.
> 
> Since then, most (but not all) HMP commands have moved elsewhere, either
> to the applicable subsystem, or to hmp.c.  Command declaration moved to
> hmp-commands.hx and hmp-commands-info.hx.
> 
> Plenty of features got added, most notably QMP.  monitor.c is now huge:
> 3400 SLOC.  Since HMP and QMP are entangled there, MAINTAINERS adds it
> to both subsystems.  Some disentangling would be nice.  Perhaps like
> this:
> 
> * Move all HMP commands to hmp.c.
> 
> * Move all QMP commands to qmp.c.
> 
> * Split the rest into three parts: HMP only (line editing, completion,
>   history, HMP parsing and dispatch, the pocket calculator, ...), QMP
>   only (QMP parsing and dispatch, events, ...), common core.
> 
> Only the much smaller common core would remain part of both subsystems.

Agreed. Put it differently, for a long time now our goal for HMP has
been to move it on top of QMP. This means that HMP commands should not
access QEMU data directly, but do QMP calls instead. We did a lot of
this work already, I can't remember what's missing.

The separation you mention is probably a good place to start. Although
we don't necessarily need everything in hmp.c, having hmp/{history.c,
completion.c, commands.c} might make more sense.

I also remember I never liked hmp-commands.hx and hmp-commands-info.hx,
in special .args_type and .params. I wanted to ditch both files, but
I don't remember what I was planning as a replacement.

Lastly, this is maybe more QMP/QAPI than HMP, but I remember there
was talk some years ago about replacing QObjects with GObject. This
is no small undertaking though.

> Speaking of the pocket calculator: my recommendation would be "nuke from
> orbit".  It adds surprising corner cases to the HMP language, and
> provides next to no value.

Pocket calculator, LOL!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]