qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <mlureau@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: marcandre lureau <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 06/12] monitor: remove mhandler.cmd_new
Date: Fri, 5 Aug 2016 09:00:30 -0400 (EDT)	[thread overview]
Message-ID: <1663552743.1347944.1470402030216.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <877fbvv0mn.fsf@dusky.pond.sub.org>

Hi

----- Original Message -----
> marcandre.lureau@redhat.com writes:
> 
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > This is no longer necessary, now that middle mode has been removed.
> 
> Well, middle mode hasn't been removed just yet, only its use.  Perhaps:
> 
>     This is no longer necessary now that we aren't using middle mode
>     anymore.

ok

> 
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  monitor.c                     |  13 +--
> >  docs/writing-qmp-commands.txt |   8 +-
> >  hmp-commands-info.hx          | 118 ++++++++++++------------
> >  hmp-commands.hx               | 208
> >  +++++++++++++++++++++---------------------
> >  4 files changed, 170 insertions(+), 177 deletions(-)
> >
> > diff --git a/monitor.c b/monitor.c
> > index 5bbe4bb..642be2e 100644
> > --- a/monitor.c
> > +++ b/monitor.c
> > @@ -130,13 +130,10 @@ typedef struct mon_cmd_t {
> >      const char *args_type;
> >      const char *params;
> >      const char *help;
> > -    union {
> > -        void (*cmd)(Monitor *mon, const QDict *qdict);
> > -        void (*cmd_new)(QDict *params, QObject **ret_data, Error **errp);
> > -    } mhandler;
> > -    /* @sub_table is a list of 2nd level of commands. If it do not exist,
> > -     * mhandler should be used. If it exist, sub_table[?].mhandler should
> > be
> > -     * used, and mhandler of 1st level plays the role of help function.
> > +    void (*cmd)(Monitor *mon, const QDict *qdict);
> > +    /* @sub_table is a list of 2nd level of commands. If it does not
> > exist,
> > +     * cmd should be used. If it exists, sub_table[?].cmd should be
> > +     * used, and cmd of 1st level plays the role of help function.
> >       */
> >      struct mon_cmd_t *sub_table;
> >      void (*command_completion)(ReadLineState *rs, int nb_args, const char
> >      *str);
> > @@ -2960,7 +2957,7 @@ static void handle_hmp_command(Monitor *mon, const
> > char *cmdline)
> >          return;
> >      }
> >  
> > -    cmd->mhandler.cmd(mon, qdict);
> > +    cmd->cmd(mon, qdict);
> >      QDECREF(qdict);
> >  }
> >  
> > diff --git a/docs/writing-qmp-commands.txt b/docs/writing-qmp-commands.txt
> > index 59aa77a..6208715 100644
> > --- a/docs/writing-qmp-commands.txt
> > +++ b/docs/writing-qmp-commands.txt
> > @@ -127,7 +127,6 @@ following at the bottom:
> >      {
> >          .name       = "hello-world",
> >          .args_type  = "",
> > -        .mhandler.cmd_new = qmp_marshal_hello_world,
> >      },
> >  
> 
> Uh, doesn't this belong to the previous commit?
> 
> >  You're done. Now build qemu, run it as suggested in the "Testing" section,
> > @@ -179,7 +178,6 @@ The last step is to update the qmp-commands.hx file:
> >      {
> >          .name       = "hello-world",
> >          .args_type  = "message:s?",
> > -        .mhandler.cmd_new = qmp_marshal_hello_world,
> >      },
> >  
> 
> Likewise.
> 
> >  Notice that the "args_type" member got our "message" argument. The
> >  character
> > @@ -337,7 +335,7 @@ we should add it to the hmp-commands.hx file:
> >          .args_type  = "message:s?",
> >          .params     = "hello-world [message]",
> >          .help       = "Print message to the standard output",
> > -        .mhandler.cmd = hmp_hello_world,
> > +        .cmd        = hmp_hello_world,
> >      },
> >  
> >  STEXI
> > @@ -459,7 +457,6 @@ The last step is to add the correspoding entry in the
> > qmp-commands.hx file:
> >      {
> >          .name       = "query-alarm-clock",
> >          .args_type  = "",
> > -        .mhandler.cmd_new = qmp_marshal_query_alarm_clock,
> >      },
> 
> Likewise.
> 
> >  
> >  Time to test the new command. Build qemu, run it as described in the
> >  "Testing"
> > @@ -518,7 +515,7 @@ in the monitor.c file. The entry for the "info
> > alarmclock" follows:
> >          .args_type  = "",
> >          .params     = "",
> >          .help       = "show information about the alarm clock",
> > -        .mhandler.info = hmp_info_alarm_clock,
> > +        .cmd        = hmp_info_alarm_clock,
> >      },
> >  
> >  To test this, run qemu and type "info alarmclock" in the user monitor.
> > @@ -605,7 +602,6 @@ To test this you have to add the corresponding
> > qmp-commands.hx entry:
> >      {
> >          .name       = "query-alarm-methods",
> >          .args_type  = "",
> > -        .mhandler.cmd_new = qmp_marshal_query_alarm_methods,
> >      },
> >  
> 
> Likewise.


Ok those are from the documentation and can be moved to previous commit.

> 
> >  Now Build qemu, run it as explained in the "Testing" section and try our
> >  new
> > diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
> > index 74446c6..19729e5 100644
> > --- a/hmp-commands-info.hx
> > +++ b/hmp-commands-info.hx
> > @@ -18,7 +18,7 @@ ETEXI
> >          .args_type  = "",
> >          .params     = "",
> >          .help       = "show the version of QEMU",
> > -        .mhandler.cmd = hmp_info_version,
> > +        .cmd        = hmp_info_version,
> >      },
> >  
> >  STEXI
> [More of the same snipped...]

However those belong with this commit (I am not sure if you meant that they should also be moved)

  reply	other threads:[~2016-08-05 13:00 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 [this message]
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
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=1663552743.1347944.1470402030216.JavaMail.zimbra@redhat.com \
    --to=mlureau@redhat.com \
    --cc=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 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).