Received: from eggs.gnu.org ([208.118.235.92]:57018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtFuO-0000ns-U0 for qemu-devel@nongnu.org; Thu, 10 Jan 2013 06:02:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtFuK-00032q-6M for qemu-devel@nongnu.org; Thu, 10 Jan 2013 06:02:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtFIE-0000rH-16 for qemu-devel@nongnu.org; Thu, 10 Jan 2013 05:23:26 -0500 From: Markus Armbruster References: <1357806754-8552-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1357806754-8552-3-git-send-email-xiawenc@linux.vnet.ibm.com> Date: Thu, 10 Jan 2013 11:23:19 +0100 In-Reply-To: <1357806754-8552-3-git-send-email-xiawenc@linux.vnet.ibm.com> (Wenchao Xia's message of "Thu, 10 Jan 2013 16:32:32 +0800") Message-ID: <87bocxl4ko.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH V4 2/4] HMP: add infrastructure for sub command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, chenwj@iis.sinica.edu.tw, lcapitulino@redhat.com Wenchao Xia writes: > This patch make parsing of hmp command aware of that it may > have sub command. Also discard simple encapsulation function > monitor_find_command() and qmp_find_cmd(). > > Signed-off-by: Wenchao Xia > --- > monitor.c | 31 +++++++++++++++++++++++-------- > 1 files changed, 23 insertions(+), 8 deletions(-) > > diff --git a/monitor.c b/monitor.c > index c7b3014..d49a362 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -130,6 +130,7 @@ typedef struct mon_cmd_t { > MonitorCompletion *cb, void *opaque); > } mhandler; > int flags; > + struct mon_cmd_t *sub_table; > } mon_cmd_t; > > /* file descriptors passed via SCM_RIGHTS */ Forgot to mention: please explain in a comment how mhandler and sub_table interact. Namely, if there are arguments, we use sub_table, else mhandler.