From: Luiz Capitulino <lcapitulino@redhat.com>
To: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH 01/25] QMP: Rename query handlers
Date: Tue, 7 Dec 2010 11:15:47 -0200 [thread overview]
Message-ID: <20101207111547.13c766dc@doriath> (raw)
In-Reply-To: <AANLkTik9NLb273jemBBvKA2JztRVGUqfXKySz=jOyBtv@mail.gmail.com>
On Tue, 7 Dec 2010 10:28:25 -0200
Miguel Di Ciurcio Filho <miguel.filho@gmail.com> wrote:
> On Mon, Dec 6, 2010 at 4:23 PM, Luiz Capitulino <lcapitulino@redhat.com> wrote:
> > Query handlers still carry their human monitor name. This commit
> > renames all of them to a more QMP-like name.
> >
> > For example, do_info_version() is renamed to qmp_query_version().
> > - * do_info_balloon(): Balloon information
> > + * qmp_query_balloon(): Balloon information
> > *
> > * Make an asynchronous request for balloon info. When the request completes
> > * a QDict will be returned according to the following specification:
> > @@ -106,7 +106,7 @@ void monitor_print_balloon(Monitor *mon, const QObject *data)
> > * "major_page_faults": 142, "minor_page_faults": 239245,
> > * "free_mem": 1014185984, "total_mem": 1044668416 }
> > */
> > -int do_info_balloon(Monitor *mon, MonitorCompletion cb, void *opaque)
> > +int qmp_query_balloon(Monitor *mon, MonitorCompletion cb, void *opaque)
> > {
>
> If the idea is to detach the human monitor from the QMP API, is there
> any reason to keep passing `Monitor *mon` to qmp_* functions?
No, I should drop it soon.
> In some parts of the code NULL is being passed.
Yes, this series is just a first step. We have lots of work to do and sometimes
I don't know what to do next, but the plan looks more or less like this:
1. Change info handlers to make directly QMP calls
This series.
2. Move all qmp_query_* functions from the qmp_query_cmds[] table to the
qmp-commands.hx one
I have this almost ready, but I'm wondering if I should take the
opportunity to drop the monitor object in this series...
3. Split all monitor commands into a human monitor part and a QMP part,
the QMP part becomes the QMP API and the human monitor just calls it
I have started doing this (maybe it's in an RFC state), but trust me,
it's very difficult to split some handlers.
One example is the do_change() one. Yes, a clearly human targeted
command. So the question is: should we split such a handler or should
we just add a good replacement?
If we choose to add a replacement, then it's going to take a lot of
time to have the QMP vs. HMP separation done. If we split the handler,
then we'll have to live with complex, ugly code for a while.
4. Make handlers return an error object
This is the new error infrastructure work, Markus will work on this.
5. Drop all Monitor object usage by QMP by introducing a QMP object
We won't pass the QMP object to handlers, it's just our interface
with the chardev layer that will change.
6. Add async command infrastructure
Not necessary step 6, we'll probably be able to do it sooner.
7. Split the monitor code inti different files
Possibly moving it to its own directory:
- monitor/monitor.c: common code
- monitor/hmp.c: human monitor
- monitor/qmp.c: (guess what)
8. Make the QMP C API a real API
Ie. do all cleanup needed to make it consumable, maybe even outside
of QEMU
9. Conquer the world
next prev parent reply other threads:[~2010-12-07 13:20 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-06 18:23 [Qemu-devel] [PATCH v1 00/25]: Monitor: First step on an internal QMP API Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 01/25] QMP: Rename query handlers Luiz Capitulino
2010-12-07 12:28 ` Miguel Di Ciurcio Filho
2010-12-07 13:15 ` Luiz Capitulino [this message]
2010-12-06 18:23 ` [Qemu-devel] [PATCH 02/25] QMP: Drop user_print usage from the qmp_query_cmds[] table Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 03/25] Monitor: Drop balloon handlers comments Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 04/25] Monitor: Move qmp_query_version() up in monitor.c Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 05/25] Monitor: Convert do_info_version_print() into do_info_version() Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 06/25] Monitor: Convert qemu_chr_info_print() into qemu_chr_info() Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 07/25] Monitor: Convert bdrv_info_print() into bdrv_info() Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 08/25] Monitor: Convert bdrv_stats_print() into bdrv_stats() Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 09/25] Monitor: Move qmp_query_cpus() up in monitor.c Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 10/25] Monitor: Convert monitor_print_cpus() into do_info_cpus() Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 11/25] Monitor: Convert do_pci_info_print() into do_pci_info() Luiz Capitulino
2010-12-06 18:23 ` [Qemu-devel] [PATCH 12/25] Monitor: Move qmp_query_kvm() up in monitor.c Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 13/25] Monitor: Convert do_info_kvm_print() into do_info_kvm() Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 14/25] Monitor: Move qmp_query_status() up in monitor.c Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 15/25] Monitor: Convert do_info_status_print() into do_info_status() Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 16/25] Monitor: Convert do_info_mice_print() into do_info_mice() Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 17/25] Monitor: Convert do_info_vnc_print() into do_info_vnc() Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 18/25] Monitor: Move qmp_query_name() up in monitor.c Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 19/25] Monitor: Convert do_info_name_print() into do_info_name() Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 20/25] Monitor: Move qmp_query_uuid() up in monitor.c Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 21/25] Monitor: Convert do_info_uuid_print() into do_info_uuid() Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 22/25] Monitor: qmp_query_migrate(): Return {} for empty MigrationState Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 23/25] Monitor: Convert do_info_migrate_print() into do_info_migrate() Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 24/25] Monitor: Introduce do_info_balloon() Luiz Capitulino
2010-12-06 18:24 ` [Qemu-devel] [PATCH 25/25] Monitor: do_info(): Drop unused code Luiz Capitulino
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=20101207111547.13c766dc@doriath \
--to=lcapitulino@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=miguel.filho@gmail.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).