From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVejt-0004o6-N8 for qemu-devel@nongnu.org; Fri, 05 Aug 2016 09:00:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVejn-0002lc-JR for qemu-devel@nongnu.org; Fri, 05 Aug 2016 09:00:36 -0400 Received: from mx3-phx2.redhat.com ([209.132.183.24]:53056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVejn-0002kb-B2 for qemu-devel@nongnu.org; Fri, 05 Aug 2016 09:00:31 -0400 Date: Fri, 5 Aug 2016 09:00:30 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <1663552743.1347944.1470402030216.JavaMail.zimbra@redhat.com> In-Reply-To: <877fbvv0mn.fsf@dusky.pond.sub.org> References: <20160721140030.28383-1-marcandre.lureau@redhat.com> <20160721140030.28383-7-marcandre.lureau@redhat.com> <877fbvv0mn.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 06/12] monitor: remove mhandler.cmd_new List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: marcandre lureau , qemu-devel@nongnu.org Hi ----- Original Message ----- > marcandre.lureau@redhat.com writes: >=20 > > From: Marc-Andr=C3=A9 Lureau > > > > This is no longer necessary, now that middle mode has been removed. >=20 > Well, middle mode hasn't been removed just yet, only its use. Perhaps: >=20 > This is no longer necessary now that we aren't using middle mode > anymore. ok >=20 > > Signed-off-by: Marc-Andr=C3=A9 Lureau > > --- > > 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 **err= p); > > - } mhandler; > > - /* @sub_table is a list of 2nd level of commands. If it do not exi= st, > > - * mhandler should be used. If it exist, sub_table[?].mhandler sho= uld > > 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 c= har > > *str); > > @@ -2960,7 +2957,7 @@ static void handle_hmp_command(Monitor *mon, cons= t > > char *cmdline) > > return; > > } > > =20 > > - cmd->mhandler.cmd(mon, qdict); > > + cmd->cmd(mon, qdict); > > QDECREF(qdict); > > } > > =20 > > 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 =3D "hello-world", > > .args_type =3D "", > > - .mhandler.cmd_new =3D qmp_marshal_hello_world, > > }, > > =20 >=20 > Uh, doesn't this belong to the previous commit? >=20 > > You're done. Now build qemu, run it as suggested in the "Testing" sect= ion, > > @@ -179,7 +178,6 @@ The last step is to update the qmp-commands.hx file= : > > { > > .name =3D "hello-world", > > .args_type =3D "message:s?", > > - .mhandler.cmd_new =3D qmp_marshal_hello_world, > > }, > > =20 >=20 > Likewise. >=20 > > 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 =3D "message:s?", > > .params =3D "hello-world [message]", > > .help =3D "Print message to the standard output", > > - .mhandler.cmd =3D hmp_hello_world, > > + .cmd =3D hmp_hello_world, > > }, > > =20 > > STEXI > > @@ -459,7 +457,6 @@ The last step is to add the correspoding entry in t= he > > qmp-commands.hx file: > > { > > .name =3D "query-alarm-clock", > > .args_type =3D "", > > - .mhandler.cmd_new =3D qmp_marshal_query_alarm_clock, > > }, >=20 > Likewise. >=20 > > =20 > > 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 =3D "", > > .params =3D "", > > .help =3D "show information about the alarm clock", > > - .mhandler.info =3D hmp_info_alarm_clock, > > + .cmd =3D hmp_info_alarm_clock, > > }, > > =20 > > 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 =3D "query-alarm-methods", > > .args_type =3D "", > > - .mhandler.cmd_new =3D qmp_marshal_query_alarm_methods, > > }, > > =20 >=20 > Likewise. Ok those are from the documentation and can be moved to previous commit. >=20 > > Now Build qemu, run it as explained in the "Testing" section and try o= ur > > 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 =3D "", > > .params =3D "", > > .help =3D "show the version of QEMU", > > - .mhandler.cmd =3D hmp_info_version, > > + .cmd =3D hmp_info_version, > > }, > > =20 > > 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)