qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V9 00/15] monitor: support sub command group in


From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH V9 00/15] monitor: support sub command group in auto completion and help
Date: Wed, 28 Aug 2013 10:16:04 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8

于 2013-8-27 21:19, Luiz Capitulino 写道:
On Tue, 27 Aug 2013 20:39:37 +0800
Wenchao Xia <address@hidden> wrote:

于 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 <address@hidden> 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.

My configure line doesn't have anything special:

  ../configure --target-list=x86_64-softmmu

  I used special cc warn flag before, it seems that by default more
flags would be set, will double check with default configure.

--
Best Regards

Wenchao Xia




reply via email to

[Prev in Thread] Current Thread [Next in Thread]