qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: berrange@redhat.com, qemu-devel@nongnu.org,
	qemu-block@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 07/11] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c
Date: Tue, 11 Jun 2019 17:09:58 +0100	[thread overview]
Message-ID: <20190611160957.GG2777@work-vm> (raw)
In-Reply-To: <20190611134043.9524-8-kwolf@redhat.com>

* Kevin Wolf (kwolf@redhat.com) wrote:
> Now that we have a monitor/ subdirectory, let's move hmp.c and qmp.c
> from the root directory there. As they contain implementations of
> monitor commands, rename them to {hmp,qmp}-cmds.c, so that {hmp,qmp}.c
> are free for the HMP and QMP infrastructure.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  docs/devel/writing-qmp-commands.txt | 9 +++++----
>  hmp.c => monitor/hmp-cmds.c         | 2 +-
>  qmp.c => monitor/qmp-cmds.c         | 2 +-
>  MAINTAINERS                         | 5 +++--
>  Makefile.objs                       | 2 +-
>  monitor/Makefile.objs               | 1 +
>  6 files changed, 12 insertions(+), 9 deletions(-)
>  rename hmp.c => monitor/hmp-cmds.c (99%)
>  rename qmp.c => monitor/qmp-cmds.c (99%)
> 
> diff --git a/docs/devel/writing-qmp-commands.txt b/docs/devel/writing-qmp-commands.txt
> index cc6ecd6d5d..46a6c48683 100644
> --- a/docs/devel/writing-qmp-commands.txt
> +++ b/docs/devel/writing-qmp-commands.txt
> @@ -20,7 +20,7 @@ new QMP command.
>  
>  2. Write the QMP command itself, which is a regular C function. Preferably,
>     the command should be exported by some QEMU subsystem. But it can also be
> -   added to the qmp.c file
> +   added to the monitor/qmp-cmds.c file
>  
>  3. At this point the command can be tested under the QMP protocol
>  
> @@ -101,7 +101,8 @@ protocol data.
>  
>  The next step is to write the "hello-world" implementation. As explained
>  earlier, it's preferable for commands to live in QEMU subsystems. But
> -"hello-world" doesn't pertain to any, so we put its implementation in qmp.c:
> +"hello-world" doesn't pertain to any, so we put its implementation in
> +monitor/qmp-cmds.c:
>  
>  void qmp_hello_world(Error **errp)
>  {
> @@ -146,7 +147,7 @@ for mandatory arguments). Finally, 'str' is the argument's type, which
>  stands for "string". The QAPI also supports integers, booleans, enumerations
>  and user defined types.
>  
> -Now, let's update our C implementation in qmp.c:
> +Now, let's update our C implementation in monitor/qmp-cmds.c:
>  
>  void qmp_hello_world(bool has_message, const char *message, Error **errp)
>  {
> @@ -267,7 +268,7 @@ monitor (HMP).
>  
>  With the introduction of the QAPI, HMP commands make QMP calls. Most of the
>  time HMP commands are simple wrappers. All HMP commands implementation exist in
> -the hmp.c file.
> +the monitor/hmp-cmds.c file.
>  
>  Here's the implementation of the "hello-world" HMP command:
>  
> diff --git a/hmp.c b/monitor/hmp-cmds.c
> similarity index 99%
> rename from hmp.c
> rename to monitor/hmp-cmds.c
> index 99414cd39c..712737cd18 100644
> --- a/hmp.c
> +++ b/monitor/hmp-cmds.c
> @@ -1,5 +1,5 @@
>  /*
> - * Human Monitor Interface
> + * Human Monitor Interface commands
>   *
>   * Copyright IBM, Corp. 2011
>   *
> diff --git a/qmp.c b/monitor/qmp-cmds.c
> similarity index 99%
> rename from qmp.c
> rename to monitor/qmp-cmds.c
> index fa1b3c1577..65520222ca 100644
> --- a/qmp.c
> +++ b/monitor/qmp-cmds.c
> @@ -1,5 +1,5 @@
>  /*
> - * QEMU Management Protocol
> + * QEMU Management Protocol commands
>   *
>   * Copyright IBM, Corp. 2011
>   *
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 10c082314c..8789c82e5c 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1925,7 +1925,8 @@ Human Monitor (HMP)
>  M: Dr. David Alan Gilbert <dgilbert@redhat.com>
>  S: Maintained
>  F: monitor/misc.c
> -F: hmp.[ch]
> +F: monitor/hmp*
> +F: hmp.h
>  F: hmp-commands*.hx
>  F: include/monitor/hmp-target.h
>  F: tests/test-hmp.c
> @@ -2045,7 +2046,7 @@ F: tests/check-qom-proplist.c
>  QMP
>  M: Markus Armbruster <armbru@redhat.com>
>  S: Supported
> -F: qmp.c
> +F: monitor/qmp*
>  F: monitor/misc.c
>  F: docs/devel/*qmp-*
>  F: docs/interop/*qmp-*
> diff --git a/Makefile.objs b/Makefile.objs
> index dd39a70b48..9495fcbc7e 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -83,8 +83,8 @@ common-obj-$(CONFIG_FDT) += device_tree.o
>  ######################################################################
>  # qapi
>  
> -common-obj-y += qmp.o hmp.o
>  common-obj-y += qapi/
> +common-obj-y += monitor/
>  endif
>  
>  #######################################################################
> diff --git a/monitor/Makefile.objs b/monitor/Makefile.objs
> index e783b0616b..a7170af6e1 100644
> --- a/monitor/Makefile.objs
> +++ b/monitor/Makefile.objs
> @@ -1 +1,2 @@
>  obj-y += misc.o
> +common-obj-y += qmp-cmds.o hmp-cmds.o
> -- 
> 2.20.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


  reply	other threads:[~2019-06-11 16:33 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 13:40 [Qemu-devel] [PATCH v2 00/11] monitor: Split monitor.c in core/HMP/QMP/misc Kevin Wolf
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 01/11] monitor: Remove unused password prompting fields Kevin Wolf
2019-06-12  6:43   ` Markus Armbruster
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 02/11] monitor: Split monitor_init in HMP and QMP function Kevin Wolf
2019-06-12  6:12   ` Markus Armbruster
2019-06-12  6:43     ` Markus Armbruster
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 03/11] monitor: Make MonitorQMP a child class of Monitor Kevin Wolf
2019-06-12  7:59   ` Markus Armbruster
2019-06-12 11:28     ` Kevin Wolf
2019-06-12 14:18       ` Markus Armbruster
2019-06-12  8:05   ` [Qemu-devel] [PATCH v2.1 02.5/11] monitor: Restrict use of Monitor member qmp to actual QMP monitors Markus Armbruster
2019-06-12  8:05   ` [Qemu-devel] [PATCH v2.1 03/11] monitor: Make MonitorQMP a child class of Monitor Markus Armbruster
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 04/11] monitor: Create MonitorHMP with readline state Kevin Wolf
2019-06-12  9:07   ` Markus Armbruster
2019-06-12  9:54     ` Peter Xu
2019-06-12 10:03     ` Kevin Wolf
2019-06-12 14:08       ` Markus Armbruster
2019-06-12 14:10         ` Dr. David Alan Gilbert
2019-06-12 15:03         ` Kevin Wolf
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 05/11] monitor: Move cmd_table to MonitorHMP Kevin Wolf
2019-06-12 11:45   ` Markus Armbruster
2019-06-12 13:55     ` Kevin Wolf
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 06/11] Move monitor.c to monitor/misc.c Kevin Wolf
2019-06-11 15:38   ` Dr. David Alan Gilbert
2019-06-12 11:57   ` Markus Armbruster
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 07/11] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c Kevin Wolf
2019-06-11 16:09   ` Dr. David Alan Gilbert [this message]
2019-06-12 12:01   ` Markus Armbruster
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 08/11] monitor: Create monitor_int.h with common definitions Kevin Wolf
2019-06-12 12:18   ` Markus Armbruster
2019-06-12 12:43   ` Markus Armbruster
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 09/11] monitor: Split out monitor/qmp.c Kevin Wolf
2019-06-12 13:11   ` Markus Armbruster
2019-06-12 15:25     ` Kevin Wolf
2019-06-13  5:38       ` Markus Armbruster
2019-06-13 14:11         ` Kevin Wolf
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 10/11] monitor: Split out monitor/hmp.c Kevin Wolf
2019-06-12 13:17   ` Markus Armbruster
2019-06-12 15:31     ` Kevin Wolf
2019-06-13  5:44       ` Markus Armbruster
2019-06-11 13:40 ` [Qemu-devel] [PATCH v2 11/11] monitor: Split out monitor/monitor.c Kevin Wolf
2019-06-12 13:49   ` Markus Armbruster
2019-06-12 15:51     ` Kevin Wolf
2019-06-11 14:18 ` [Qemu-devel] [PATCH v2 00/11] monitor: Split monitor.c in core/HMP/QMP/misc no-reply
2019-06-11 15:24 ` no-reply
2019-06-12 14:22 ` 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=20190611160957.GG2777@work-vm \
    --to=dgilbert@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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).