All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 12/12] Drop qmp-commands.hx
Date: Fri, 05 Aug 2016 16:56:06 +0200	[thread overview]
Message-ID: <87lh0bp8mx.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20160721140030.28383-13-marcandre.lureau@redhat.com> (marcandre lureau's message of "Thu, 21 Jul 2016 18:00:30 +0400")

marcandre.lureau@redhat.com writes:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Only the documentation remains useful, so strip it.

What about:

    The only remaining function of qmp-commands.hx is to let us generate
    qmp-commands.txt from it.  Replace qmp-commands.hx by qmp-commands.txt.

Assuming that's what you do.  Is it?

>                                                     (a later update will
> move the documentation in the respective json files and generate the
> text file)

Suggest "again generate".

> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  .gitignore                          |    1 -
>  MAINTAINERS                         |    2 +-
>  Makefile                            |    3 -
>  docs/qapi-code-gen.txt              |    6 +-
>  docs/writing-qmp-commands.txt       |   38 --
>  qmp-commands.hx => qmp-commands.txt | 1113 +----------------------------------
>  6 files changed, 7 insertions(+), 1156 deletions(-)
>  rename qmp-commands.hx => qmp-commands.txt (87%)
>
> diff --git a/.gitignore b/.gitignore
> index 88ec249..0ab8263 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -53,7 +53,6 @@
>  /qemu-bridge-helper
>  /qemu-monitor.texi
>  /qemu-monitor-info.texi
> -/qmp-commands.txt
>  /vscclient
>  /fsdev/virtfs-proxy-helper
>  *.[1-9]
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d1439a8..ff52548 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1238,7 +1238,7 @@ M: Markus Armbruster <armbru@redhat.com>
>  S: Supported
>  F: qmp.c
>  F: monitor.c
> -F: qmp-commands.hx
> +F: qmp-commands.txt
>  F: docs/*qmp-*
>  F: scripts/qmp/
>  T: git git://repo.or.cz/qemu/armbru.git qapi-next
> diff --git a/Makefile b/Makefile
> index fcdc192..8ec1c3e 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -554,9 +554,6 @@ qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool
>  qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool
>  	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
>  
> -qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx $(SRC_PATH)/scripts/hxtool
> -	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
> -
>  qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
>  	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
>  
> diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt
> index de298dc..5d4c2cd 100644
> --- a/docs/qapi-code-gen.txt
> +++ b/docs/qapi-code-gen.txt
> @@ -964,9 +964,9 @@ Example:
>  
>  Used to generate the marshaling/dispatch functions for the commands
>  defined in the schema. The generated code implements
> -qmp_marshal_COMMAND() (mentioned in qmp-commands.hx, and registered
> -automatically), and declares qmp_COMMAND() that the user must
> -implement.  The following files are generated:
> +qmp_marshal_COMMAND() (registered automatically), and declares
> +qmp_COMMAND() that the user must implement.  The following files are
> +generated:

I see you're thorough :)

>  
>  $(prefix)qmp-marshal.c: command marshal/dispatch functions for each
>                          QMP command defined in the schema. Functions
> diff --git a/docs/writing-qmp-commands.txt b/docs/writing-qmp-commands.txt
> index 6208715..cfa6fe7 100644
> --- a/docs/writing-qmp-commands.txt
> +++ b/docs/writing-qmp-commands.txt
> @@ -119,16 +119,6 @@ There are a few things to be noticed:
>  5. Printing to the terminal is discouraged for QMP commands, we do it here
>     because it's the easiest way to demonstrate a QMP command
>  
> -Now a little hack is needed. As we're still using the old QMP server we need
> -to add the new command to its internal dispatch table. This step won't be
> -required in the near future. Open the qmp-commands.hx file and add the

For a value of "near": almost five years!

> -following at the bottom:
> -
> -    {
> -        .name       = "hello-world",
> -        .args_type  = "",
> -    },
> -
>  You're done. Now build qemu, run it as suggested in the "Testing" section,
>  and then type the following QMP command:
>  
> @@ -173,20 +163,6 @@ There are two important details to be noticed:
>  2. The C implementation signature must follow the schema's argument ordering,
>     which is defined by the "data" member
>  
> -The last step is to update the qmp-commands.hx file:
> -
> -    {
> -        .name       = "hello-world",
> -        .args_type  = "message:s?",
> -    },
> -
> -Notice that the "args_type" member got our "message" argument. The character
> -"s" stands for "string" and "?" means it's optional. This too must be ordered
> -according to the C implementation and schema file. You can look for more
> -examples in the qmp-commands.hx file if you need to define more arguments.
> -
> -Again, this step won't be required in the future.
> -
>  Time to test our new version of the "hello-world" command. Build qemu, run it as
>  described in the "Testing" section and then send two commands:
>  
> @@ -452,13 +428,6 @@ There are a number of things to be noticed:
>  6. You have to include the "qmp-commands.h" header file in qemu-timer.c,
>     otherwise qemu won't build
>  
> -The last step is to add the correspoding entry in the qmp-commands.hx file:
> -
> -    {
> -        .name       = "query-alarm-clock",
> -        .args_type  = "",
> -    },
> -
>  Time to test the new command. Build qemu, run it as described in the "Testing"
>  section and try this:
>  
> @@ -597,13 +566,6 @@ iteration of the loop. That's because the alarm timer method in use is the
>  first element of the alarm_timers array. Also notice that QAPI lists are handled
>  by hand and we return the head of the list.
>  
> -To test this you have to add the corresponding qmp-commands.hx entry:
> -
> -    {
> -        .name       = "query-alarm-methods",
> -        .args_type  = "",
> -    },
> -
>  Now Build qemu, run it as explained in the "Testing" section and try our new
>  command:
>  
> diff --git a/qmp-commands.hx b/qmp-commands.txt
> similarity index 87%
> rename from qmp-commands.hx
> rename to qmp-commands.txt

Shouldn't qmp-commands.txt live in docs/?

> index 1ad8dda..f796342 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.txt
> @@ -1,8 +1,3 @@

Instead of reviewing this diff, let me review how your patch changes
qmp-commands.txt:

   diff -u bld-x86/qmp-commands.txt qmp-commands.txt
  --- bld-x86/qmp-commands.txt	2016-08-05 16:51:04.854000570 +0200
  +++ qmp-commands.txt	2016-08-05 16:54:23.650093974 +0200
  @@ -3381,7 +3381,7 @@
                       "child": "children.1" } }
   <- { "return": {} }

  -@query-named-block-nodes
  +query-named-block-nodes
   ------------------------

   Return a list of BlockDeviceInfo for all the named block driver nodes
  @@ -3507,7 +3507,7 @@
        ]
      }

  -@query-memory-devices
  +query-memory-devices
   --------------------

   Return a list of memory devices.
  @@ -3525,7 +3525,8 @@
                           "slot": 0},
                      "type": "dimm"
                    } ] }
  -@query-acpi-ospm-status
  +
  +query-acpi-ospm-status
   --------------------

   Return list of ACPIOSTInfo for devices that support status reporting
  @@ -3538,6 +3539,7 @@
                    { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
                    { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
      ]}
  +
   rtc-reset-reinjection
   ---------------------

  @@ -3549,6 +3551,7 @@

   -> { "execute": "rtc-reset-reinjection" }
   <- { "return": {} }
  +
   trace-event-get-state
   ---------------------

  @@ -3572,6 +3575,7 @@

   -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
   <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
  +
   trace-event-set-state
   ---------------------

Sensible fixes only.  Separate patch?

  reply	other threads:[~2016-08-05 14:56 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 14:00 [Qemu-devel] [PATCH v2 00/12] qapi: remove the 'middle' mode marcandre.lureau
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 01/12] qapi-schema: use generated marshaller for 'qmp_capabilities' marcandre.lureau
2016-08-05 10:52   ` Markus Armbruster
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 02/12] qapi-schema: add 'device_add' marcandre.lureau
2016-07-21 20:44   ` Eric Blake
2016-07-22  7:13     ` Marc-André Lureau
2016-08-05 12:10   ` Markus Armbruster
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 03/12] monitor: register gen:false commands manually marcandre.lureau
2016-07-21 20:50   ` Eric Blake
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 04/12] monitor: remove usage of generated marshal functions marcandre.lureau
2016-08-05 12:17   ` Markus Armbruster
2016-08-05 12:22     ` Marc-André Lureau
2016-08-05 13:43       ` Markus Armbruster
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 05/12] monitor: register the qapi generated commands marcandre.lureau
2016-07-21 20:56   ` Eric Blake
2016-08-05 12:42   ` Markus Armbruster
2016-08-08 10:10     ` Paolo Bonzini
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 06/12] monitor: remove mhandler.cmd_new marcandre.lureau
2016-07-21 21:02   ` Eric Blake
2016-07-22  7:20     ` Marc-André Lureau
2016-08-05 12:52   ` Markus Armbruster
2016-08-05 13:00     ` Marc-André Lureau
2016-08-05 13:44       ` Markus Armbruster
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 07/12] monitor: implement 'qmp_query_commands' without qmp_cmds marcandre.lureau
2016-07-21 22:51   ` Eric Blake
2016-08-05 13:25   ` Markus Armbruster
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 08/12] build-sys: remove qmp-commands-old.h marcandre.lureau
2016-07-21 22:52   ` Eric Blake
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 09/12] qapi: remove the "middle" mode marcandre.lureau
2016-07-21 22:55   ` Eric Blake
2016-07-22  7:35     ` Marc-André Lureau
2016-08-05 13:31   ` Markus Armbruster
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 10/12] monitor: use qmp_dispatch() marcandre.lureau
2016-08-05 14:43   ` Markus Armbruster
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 11/12] qmp: update qmp_query_spice fallback marcandre.lureau
2016-08-05 13:40   ` Markus Armbruster
2016-08-05 13:43     ` Marc-André Lureau
2016-08-05 14:38       ` Markus Armbruster
2016-07-21 14:00 ` [Qemu-devel] [PATCH v2 12/12] Drop qmp-commands.hx marcandre.lureau
2016-08-05 14:56   ` Markus Armbruster [this message]
2016-08-05 18:32     ` Marc-André Lureau
2016-08-09 13:08       ` Markus Armbruster
2016-08-09 14:50         ` Marc-André Lureau
2016-08-09 16:32           ` 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=87lh0bp8mx.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=marcandre.lureau@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.