From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEIZ8-0006QN-Li for qemu-devel@nongnu.org; Tue, 27 Aug 2013 08:40:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEIYv-0008S7-IT for qemu-devel@nongnu.org; Tue, 27 Aug 2013 08:40:10 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:48735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEIYu-0008RT-UG for qemu-devel@nongnu.org; Tue, 27 Aug 2013 08:39:57 -0400 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 27 Aug 2013 22:28:40 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 4C7242CE804C for ; Tue, 27 Aug 2013 22:39:50 +1000 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7RCNjDg62259332 for ; Tue, 27 Aug 2013 22:23:45 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r7RCdnqU031404 for ; Tue, 27 Aug 2013 22:39:49 +1000 Message-ID: <521C9E09.9060204@linux.vnet.ibm.com> Date: Tue, 27 Aug 2013 20:39:37 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1377245887-22745-1-git-send-email-xiawenc@linux.vnet.ibm.com> <20130826115520.60617e53@redhat.com> <521C0427.5010409@linux.vnet.ibm.com> In-Reply-To: <521C0427.5010409@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V9 00/15] monitor: support sub command group in auto completion and help List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com 于 2013-8-27 9:43, Wenchao Xia 写道: > 于 2013-8-26 23:55, Luiz Capitulino 写道: >> On Fri, 23 Aug 2013 16:17:52 +0800 >> Wenchao Xia wrote: >> >>> This series make auto completion and help functions works normal for sub >>> command, by using reentrant functions. In order to do that, global >>> variables >>> are not directly used in those functions any more. With this series, >>> cmd_table >>> is a member of structure Monitor so it is possible to create a >>> monitor with >>> different command table now, auto completion will work in that >>> monitor. In >>> short, "info" is not treated as a special case now, this series >>> ensure help >>> and auto complete function works normal for any sub command added in >>> the future. >>> >>> Patch 5 replaced cur_mon with rs->mon, it is safe because: >>> monitor_init() calls readline_init() which initialize mon->rs, result is >>> mon->rs->mon == mon. Then qemu_chr_add_handlers() is called, which make >>> monitor_read() function take *mon as its opaque. Later, when user input, >>> monitor_read() is called, where cur_mon is set to *mon by "cur_mon = >>> opaque". >>> If qemu's monitors run in one thread, then later in >>> readline_handle_byte() >>> and readline_comletion(), cur_mon is actually equal to rs->mon, in >>> another >>> word, it points to the monitor instance, so it is safe to replace >>> *cur_mon >>> in those functions. >>> >>> Thanks for Luiz and Eric for reviewing. >> >> This one doesn't even build :( >> >> /home/lcapitulino/work/src/upstream/qmp-unstable/monitor.c: In >> function ‘help_cmd’: >> /home/lcapitulino/work/src/upstream/qmp-unstable/monitor.c:952:1: >> error: label ‘cleanup’ defined but not used [-Werror=unused-label] >> cc1: all warnings being treated as errors >> make[1]: *** [monitor.o] Error 1 >> make[1]: *** Waiting for unfinished jobs.... >> make: *** [subdir-x86_64-softmmu] Error 2 >> > Sorry for it, I missed that CC flag in my configure, will fix. > It would be great if you can share your configure settings. > Respined v10 and tested with -Werror=unused-label, hope no other issue is missed in my test. -- Best Regards Wenchao Xia