All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] Monitor brain dump
Date: Wed, 5 Oct 2016 13:03:17 -0400	[thread overview]
Message-ID: <20161005130317.1f2fe571@redhat.com> (raw)
In-Reply-To: <87eg3ulq9n.fsf@dusky.pond.sub.org>

On Wed, 05 Oct 2016 18:22:28 +0200
Markus Armbruster <armbru@redhat.com> 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	other threads:[~2016-10-05 17:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05 16:22 [Qemu-devel] Monitor brain dump Markus Armbruster
2016-10-05 17:03 ` Luiz Capitulino [this message]
2016-10-05 17:43 ` Dr. David Alan Gilbert
2016-10-05 18:48   ` Laszlo Ersek
2016-10-05 19:19     ` Dr. David Alan Gilbert
2016-10-06 11:07   ` Paolo Bonzini
2016-10-06 11:10     ` Peter Maydell
2016-10-06 11:14       ` Paolo Bonzini
2016-10-06 11:20         ` Marc-André Lureau
2016-10-07 10:14     ` Kevin Wolf
2016-10-06 11:26   ` Markus Armbruster

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=20161005130317.1f2fe571@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.