From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVecD-0008Ee-Hv for qemu-devel@nongnu.org; Fri, 05 Aug 2016 08:52:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVec8-0000t2-IK for qemu-devel@nongnu.org; Fri, 05 Aug 2016 08:52:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVec8-0000sn-AL for qemu-devel@nongnu.org; Fri, 05 Aug 2016 08:52:36 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 464D081110 for ; Fri, 5 Aug 2016 12:52:35 +0000 (UTC) From: Markus Armbruster References: <20160721140030.28383-1-marcandre.lureau@redhat.com> <20160721140030.28383-7-marcandre.lureau@redhat.com> Date: Fri, 05 Aug 2016 14:52:32 +0200 In-Reply-To: <20160721140030.28383-7-marcandre.lureau@redhat.com> (marcandre lureau's message of "Thu, 21 Jul 2016 18:00:24 +0400") Message-ID: <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: marcandre.lureau@redhat.com Cc: qemu-devel@nongnu.org marcandre.lureau@redhat.com writes: > From: Marc-Andr=C3=A9 Lureau > > 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. > 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 **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 shoul= d 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 exi= st, > + * 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 cha= r *str); > @@ -2960,7 +2957,7 @@ static void handle_hmp_command(Monitor *mon, const = char *cmdline) > return; > } >=20=20 > - cmd->mhandler.cmd(mon, qdict); > + cmd->cmd(mon, qdict); > QDECREF(qdict); > } >=20=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? > You're done. Now build qemu, run it as suggested in the "Testing" sectio= n, > @@ -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. > Notice that the "args_type" member got our "message" argument. The chara= cter > @@ -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=20 > STEXI > @@ -459,7 +457,6 @@ The last step is to add the correspoding entry in the= qmp-commands.hx file: > { > .name =3D "query-alarm-clock", > .args_type =3D "", > - .mhandler.cmd_new =3D qmp_marshal_query_alarm_clock, > }, Likewise. >=20=20 > Time to test the new command. Build qemu, run it as described in the "Te= sting" > @@ -518,7 +515,7 @@ in the monitor.c file. The entry for the "info alarmc= lock" 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=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-co= mmands.hx entry: > { > .name =3D "query-alarm-methods", > .args_type =3D "", > - .mhandler.cmd_new =3D qmp_marshal_query_alarm_methods, > }, >=20=20 Likewise. > 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 =3D "", > .params =3D "", > .help =3D "show the version of QEMU", > - .mhandler.cmd =3D hmp_info_version, > + .cmd =3D hmp_info_version, > }, >=20=20 > STEXI [More of the same snipped...]