From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGRyK-0003CM-LS for qemu-devel@nongnu.org; Fri, 24 Jun 2016 10:20:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGRyJ-0005QG-FE for qemu-devel@nongnu.org; Fri, 24 Jun 2016 10:20:40 -0400 Received: from mail-vk0-x243.google.com ([2607:f8b0:400c:c05::243]:36491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGRyJ-0005QA-9U for qemu-devel@nongnu.org; Fri, 24 Jun 2016 10:20:39 -0400 Received: by mail-vk0-x243.google.com with SMTP id v188so19041913vkf.3 for ; Fri, 24 Jun 2016 07:20:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <576CB991.60800@redhat.com> References: <20160623000809.4522-1-marcandre.lureau@redhat.com> <20160623000809.4522-7-marcandre.lureau@redhat.com> <576CB991.60800@redhat.com> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Fri, 24 Jun 2016 16:20:38 +0200 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 06/12] monitor: remove mhandler.cmd_new List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: QEMU , Markus Armbruster Hi On Fri, Jun 24, 2016 at 6:39 AM, Eric Blake wrote: > On 06/22/2016 06:08 PM, marcandre.lureau@redhat.com wrote: >> From: Marc-Andr=C3=A9 Lureau >> >> This is no longer necessary, now that middle mode has been removed. >> >> Signed-off-by: Marc-Andr=C3=A9 Lureau >> --- >> docs/writing-qmp-commands.txt | 8 +- >> hmp-commands-info.hx | 118 ++++++++++++------------ >> hmp-commands.hx | 206 +++++++++++++++++++++--------------= ------- >> monitor.c | 11 +-- >> 4 files changed, 168 insertions(+), 175 deletions(-) > > The changes to hmp-commands*.hx are mechanical; you may want to set up > git to order the diff so that more relevant files like monitor.c are > listed first. Do that by 'git config diff.orderFile /path/to/file', > then in that file, listing globs in the order that you want to prioritize= . > Nice tip, didn't know about it. I wonder if it would be worth to have one in qemu source tree.. >> +++ 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; >> + void (*cmd)(Monitor *mon, const QDict *qdict); >> /* @sub_table is a list of 2nd level of commands. If it do not exis= t, > > As long as you are touching this, fix the grammar bug: s/do/does/ > >> - * mhandler should be used. If it exist, sub_table[?].mhandler shou= ld be >> - * used, and mhandler of 1st level plays the role of help function. >> + * cmd should be used. If it exist, sub_table[?].cmd should be > > s/exist/exists/ > fixed both >> + * 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 ch= ar *str); >> @@ -2927,7 +2924,7 @@ static void handle_hmp_command(Monitor *mon, const= char *cmdline) >> return; >> } >> >> - cmd->mhandler.cmd(mon, qdict); >> + cmd->cmd(mon, qdict); >> QDECREF(qdict); >> } >> >> > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > --=20 Marc-Andr=C3=A9 Lureau