[Qemu-devel] [PATCH V10 06/15] monitor: call sortcmdlist() only one time

2013-08-27 Thread Wenchao Xia
It doesn't need to be done for every monitor, so change it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index fffb434..db4d441 100644 --- a/monitor.c +++ b/monitor.c

[Qemu-devel] [PATCH V10 12/15] monitor: refine monitor_find_completion()

2013-08-27 Thread Wenchao Xia
contains the necessary code to support sub command and works as the reentrant function. The global info_cmds is still used in second part, which will be replaced by sub command code later. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c

[Qemu-devel] [PATCH V10 04/15] monitor: avoid use of global *cur_mon in monitor_find_completion()

2013-08-27 Thread Wenchao Xia
Parameter *mon is added, and local variable *mon added in previous patch is removed. The caller readline_completion(), pass rs-mon as value, which should be initialized in readline_init() called by monitor_init(). Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl

[Qemu-devel] [PATCH V10 02/15] monitor: avoid use of global *cur_mon in file_completion()

2013-08-27 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index 31b527d..a59a402 100644 --- a/monitor.c +++ b/monitor.c @@ -4034,7 +4034,7

[Qemu-devel] [PATCH V10 14/15] monitor: allow help show message for single command in sub group

2013-08-27 Thread Wenchao Xia
A new parameter type 'S' is introduced to allow user input any string. help info block works normal now. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- hmp-commands.hx |2 +- monitor.c | 27 +++ 2 files

[Qemu-devel] [PATCH V10 07/15] monitor: split off monitor_data_init()

2013-08-27 Thread Wenchao Xia
the human style command from QMP input, then send the command to a normal mode monitor. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c | 20 +++- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/monitor.c b/monitor.c index db4d441..bd02112 100644

[Qemu-devel] [PATCH V10 11/15] monitor: support sub command in help

2013-08-27 Thread Wenchao Xia
command group is added in any depth, help will automatically work for it. Still help info block will show error since command parser reject additional parameter, which can be improved later. log is still treated as a special case. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c

[Qemu-devel] [PATCH V10 15/15] monitor: improve auto complete of help for single command in sub group

2013-08-27 Thread Wenchao Xia
Now special case help * in auto completion can work with sub commands, such as help info u*. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/monitor.c b

[Qemu-devel] [PATCH V10 10/15] monitor: refine parse_cmdline()

2013-08-27 Thread Wenchao Xia
, instead of return with MAX_ARGS of parsed args in old code. This should not impact much since it is rare that user input many args in monitor's help and auto complete scenario. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c | 51

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

2013-08-27 Thread Wenchao Xia
于 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 xiaw...@linux.vnet.ibm.com wrote: This series make auto completion and help functions works normal for sub command, by using reentrant functions. In order to do that, global

Re: [Qemu-devel] [PATCH V2 1/3] qemu-iotests: add unix socket help program

2013-08-27 Thread Wenchao Xia
于 2013-8-28 9:11, Eric Blake 写道: On 08/26/2013 08:52 PM, Wenchao Xia wrote: This program can do a sendmsg call to transfer fd with unix socket, which is not supported in python2. The built binary will not be deleted in clean, but it is a existing issue in ./tests, which should be solved

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

2013-08-27 Thread Wenchao Xia
于 2013-8-27 21:19, Luiz Capitulino 写道: On Tue, 27 Aug 2013 20:39:37 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com 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 xiaw...@linux.vnet.ibm.com wrote: This series make

Re: [Qemu-devel] [PATCH V8 00/13] monitor: support sub command group in auto completion and help

2013-08-27 Thread Wenchao Xia
于 2013-8-22 21:12, Luiz Capitulino 写道: On Thu, 22 Aug 2013 17:16:23 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013-8-20 22:04, Luiz Capitulino 写道: On Tue, 30 Jul 2013 12:03:11 -0400 Luiz Capitulino lcapitul...@redhat.com wrote: On Fri, 26 Jul 2013 11:20:29 +0800 Wenchao Xia xiaw

Re: [Qemu-devel] [RFC] aio: add aio_context_acquire() and aio_context_release()

2013-08-27 Thread Wenchao Xia
, test_acquire); g_test_add_func(/aio/bh/schedule, test_bh_schedule); g_test_add_func(/aio/bh/schedule10, test_bh_schedule10); g_test_add_func(/aio/bh/cancel, test_bh_cancel); -- Best Regards Wenchao Xia

Re: [Qemu-devel] [RFC] aio: add aio_context_acquire() and aio_context_release()

2013-08-27 Thread Wenchao Xia
); -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 03/16] ipack: Pass size to ipack_bus_new_inplace()

2013-08-26 Thread Wenchao Xia
To be passed to qbus_create_inplace(). Simplify DEVICE() cast to avoid parent field access. s-dev will always point to pci_dev, so this change is safe. Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Signed-off-by: Andreas Färber afaer...@suse.de --- hw/char/ipack.c | 3

Re: [Qemu-devel] [PATCH 12/16] qdev: Pass size to qbus_create_inplace()

2013-08-26 Thread Wenchao Xia
); /* Returns 0 if either devfn or busfn skip walk somewhere in cursion, -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 15/16] qdev-monitor: Clean up qdev_device_add() variable naming

2013-08-26 Thread Wenchao Xia
); if (!bus) { qerror_report(QERR_NO_BUS_FOR_DEVICE, - k-bus_type, driver); + dc-bus_type, driver); return NULL; } } -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 13/16] qom: Pass available size to object_initialize()

2013-08-26 Thread Wenchao Xia
(Type type) type_initialize(type); obj = g_malloc(type-instance_size); -object_initialize_with_type(obj, type); +object_initialize_with_type(obj, type-instance_size, type); obj-free = g_free; return obj; -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 00/16] qom: Assert sufficient object instance size

2013-08-26 Thread Wenchao Xia
I have not looked deep into QOM, so only reviewed the code in this series, and have some minor comments for patch 12, 13, and 15. For other part, Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Hello, Peter remarked that object_initialize() on a GICState struct field would not check

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

2013-08-26 Thread Wenchao Xia
于 2013-8-26 23:55, Luiz Capitulino 写道: On Fri, 23 Aug 2013 16:17:52 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com 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

Re: [Qemu-devel] [PATCH 0/3] qemu-iotests: add test for fd passing via SCM rights

2013-08-26 Thread Wenchao Xia
于 2013-8-26 11:13, Wenchao Xia 写道: This series add test case for fd passing with unix socket at runtime. Since getfd and closefd interface will interact with monitor's data, so it will help to do regression test for monitor patches. Since python2 do not support sendmsg(), so a C helper program

[Qemu-devel] [PATCH V2 1/3] qemu-iotests: add unix socket help program

2013-08-26 Thread Wenchao Xia
This program can do a sendmsg call to transfer fd with unix socket, which is not supported in python2. The built binary will not be deleted in clean, but it is a existing issue in ./tests, which should be solved in another patch. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH V2 0/3] qemu-iotests: add test for fd passing via SCM rights

2013-08-26 Thread Wenchao Xia
missing $ in the makefile rule. Wenchao Xia (3): 1 qemu-iotests: add unix socket help program 2 qemu-iotests: add infrastructure of fd passing via SCM 3 qemu-iotests: add tests for runtime fd passing via SCM rights QMP/qmp.py |6 ++ configure

[Qemu-devel] [PATCH V2 2/3] qemu-iotests: add infrastructure of fd passing via SCM

2013-08-26 Thread Wenchao Xia
This patch make use of the compiled scm helper program to transfer fd via unix socket at runtime. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- QMP/qmp.py|6 ++ tests/qemu-iotests/check |1 + tests/qemu-iotests/iotests.py | 26

[Qemu-devel] [PATCH V2 3/3] qemu-iotests: add tests for runtime fd passing via SCM rights

2013-08-26 Thread Wenchao Xia
This case will test whether the monitor can receive fd at runtime. To verify better, additional monitor is created to see if qemu can handler two monitor instance correctly. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/045 | 37

[Qemu-devel] [PATCH 0/3] qemu-iotests: add test for fd passing via SCM rights

2013-08-25 Thread Wenchao Xia
This series add test case for fd passing with unix socket at runtime. Since getfd and closefd interface will interact with monitor's data, so it will help to do regression test for monitor patches. Since python2 do not support sendmsg(), so a C helper program is added to do the job. Wenchao Xia

[Qemu-devel] [PATCH 1/3] qemu-iotests: add unix socket help program

2013-08-25 Thread Wenchao Xia
This program can do a sendmsg call to transfer fd with unix socket, which is not supported in python2. The built binary will not be deleted in clean, but it is a existing issue in ./tests, which should be solved in another patch. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH 2/3] qemu-iotests: add infrastructure of fd passing via SCM

2013-08-25 Thread Wenchao Xia
This patch make use of the compiled scm helper program to transfer fd via unix socket at runtime. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- QMP/qmp.py|6 ++ tests/qemu-iotests/check |1 + tests/qemu-iotests/iotests.py | 26

[Qemu-devel] [PATCH 3/3] qemu-iotests: add tests for runtime fd passing via SCM rights

2013-08-25 Thread Wenchao Xia
This case will test whether the monitor can receive fd at runtime. To verify better, additional monitor is created to see if qemu can handler two monitor instance correctly. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/045 | 37

[Qemu-devel] [PATCH V9 08/15] monitor: avoid direct use of global variable *mon_cmds

2013-08-23 Thread Wenchao Xia
New member *cmd_table is added in structure Monitor to avoid direct usage of *mon_cmds. Now monitor have an associated command table, when global variable *info_cmds is also discarded, structure Monitor would gain full control about how to deal with user input. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V9 03/15] monitor: avoid use of global *cur_mon in block_completion_it()

2013-08-23 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index 30819fa..6171c75 100644 --- a/monitor.c +++ b/monitor.c @@ -4090,14

[Qemu-devel] [PATCH V9 01/15] monitor: avoid use of global *cur_mon in cmd_completion()

2013-08-23 Thread Wenchao Xia
A new local variable *mon is added in monitor_find_completion() to make compile pass, which will be removed later in conversion patch for monitor_find_completion(). Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c | 13

[Qemu-devel] [PATCH V9 00/15] monitor: support sub command group in auto completion and help

2013-08-23 Thread Wenchao Xia
can pass both on upstream and this series, but it may require a bit more code, so send it later as another series. Wenchao Xia (15): 1 monitor: avoid use of global *cur_mon in cmd_completion() 2 monitor: avoid use of global *cur_mon in file_completion() 3 monitor: avoid use of global *cur_mon

[Qemu-devel] [PATCH V9 04/15] monitor: avoid use of global *cur_mon in monitor_find_completion()

2013-08-23 Thread Wenchao Xia
Parameter *mon is added, and local variable *mon added in previous patch is removed. The caller readline_completion(), pass rs-mon as value, which should be initialized in readline_init() called by monitor_init(). Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl

[Qemu-devel] [PATCH V9 06/15] monitor: call sortcmdlist() only one time

2013-08-23 Thread Wenchao Xia
It doesn't need to be done for every monitor, so change it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 63a779f..bf019e2 100644 --- a/monitor.c +++ b/monitor.c

[Qemu-devel] [PATCH V9 10/15] monitor: refine parse_cmdline()

2013-08-23 Thread Wenchao Xia
, instead of return with MAX_ARGS of parsed args in old code. This should not impact much since it is rare that user input many args in monitor's help and auto complete scenario. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c | 51

[Qemu-devel] [PATCH V9 11/15] monitor: support sub command in help

2013-08-23 Thread Wenchao Xia
command group is added in any depth, help will automatically work for it. Still help info block will show error since command parser reject additional parameter, which can be improved later. log is still treated as a special case. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric

[Qemu-devel] [PATCH V9 05/15] monitor: avoid use of global *cur_mon in readline_completion()

2013-08-23 Thread Wenchao Xia
Now all completion functions do not use *cur_mon any more, instead they use rs-mon. In short, structure ReadLineState decide where the complete action would be taken now. Tested with the case that qemu have two telnet monitors, auto completion function works normal. Signed-off-by: Wenchao Xia

[Qemu-devel] [PATCH V9 02/15] monitor: avoid use of global *cur_mon in file_completion()

2013-08-23 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index e0154a8..30819fa 100644 --- a/monitor.c +++ b/monitor.c @@ -4034,7 +4034,7

[Qemu-devel] [PATCH V9 12/15] monitor: refine monitor_find_completion()

2013-08-23 Thread Wenchao Xia
contains the necessary code to support sub command and works as the reentrant function. The global info_cmds is still used in second part, which will be replaced by sub command code later. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c

[Qemu-devel] [PATCH V9 07/15] monitor: split off monitor_data_init()

2013-08-23 Thread Wenchao Xia
the human style command from QMP input, then send the command to a normal mode monitor. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c | 20 +++- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/monitor.c b/monitor.c index bf019e2..3ac98ef 100644

[Qemu-devel] [PATCH V9 15/15] monitor: improve auto complete of help for single command in sub group

2013-08-23 Thread Wenchao Xia
Now special case help * in auto completion can work with sub commands, such as help info u*. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/monitor.c b

[Qemu-devel] [PATCH V9 09/15] monitor: code move for parse_cmdline()

2013-08-23 Thread Wenchao Xia
help_cmd() need this function later, so move it. get_str() is called by parse_cmdline() so it is moved also. Some code style error reported by check script, is also fixed. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c | 191

[Qemu-devel] [PATCH V9 14/15] monitor: allow help show message for single command in sub group

2013-08-23 Thread Wenchao Xia
A new parameter type 'S' is introduced to allow user input any string. help info block works normal now. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- hmp-commands.hx |2 +- monitor.c | 27 +++ 2 files

[Qemu-devel] [PATCH V9 13/15] monitor: support sub command in auto completion

2013-08-23 Thread Wenchao Xia
command is still treated as a special case, since it is not a sub command group but want to auto complete command in root command table. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c | 14 +++--- 1 files changed, 7 insertions

Re: [Qemu-devel] [PATCH V8 00/13] monitor: support sub command group in auto completion and help

2013-08-22 Thread Wenchao Xia
于 2013-8-20 22:04, Luiz Capitulino 写道: On Tue, 30 Jul 2013 12:03:11 -0400 Luiz Capitulino lcapitul...@redhat.com wrote: On Fri, 26 Jul 2013 11:20:29 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: This series make auto completion and help functions works normal for sub command, by using

Re: [Qemu-devel] [PATCH v5 0/8] Implement reference count for BlockDriverState [resend]

2013-08-22 Thread Wenchao Xia
@ x86_64. Do I missed some steps? -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V8 00/13] monitor: support sub command group in auto completion and help

2013-08-21 Thread Wenchao Xia
于 2013-8-20 22:04, Luiz Capitulino 写道: On Tue, 30 Jul 2013 12:03:11 -0400 Luiz Capitulino lcapitul...@redhat.com wrote: On Fri, 26 Jul 2013 11:20:29 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: This series make auto completion and help functions works normal for sub command, by using

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-21 Thread Wenchao Xia
于 2013-8-21 16:45, Stefan Hajnoczi 写道: On Tue, Aug 20, 2013 at 05:59:58PM +0800, Wenchao Xia wrote: 于 2013-8-16 16:12, Wenchao Xia 写道: 于 2013-8-16 15:15, Wenchao Xia 写道: 于 2013-8-16 0:32, Michael Roth 写道: Quoting Michael Roth (2013-08-15 10:23:20) Quoting Wenchao Xia (2013-08-13 03:44:39

Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers

2013-08-20 Thread Wenchao Xia
gint source_timeout = -1 around line 2816 in glib/gmain.c Thanks for the explanation. It seems *timeout is always set to -1 before calling GSource's prepare(), so *timeout = qemu_soonest_timeout(*timeout, 10); will always get *timeout = 10, so this call can be saved. -- Best Regards Wenchao

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-20 Thread Wenchao Xia
于 2013-8-16 16:12, Wenchao Xia 写道: 于 2013-8-16 15:15, Wenchao Xia 写道: 于 2013-8-16 0:32, Michael Roth 写道: Quoting Michael Roth (2013-08-15 10:23:20) Quoting Wenchao Xia (2013-08-13 03:44:39) 于 2013-8-13 1:01, Michael Roth 写道: Quoting Paolo Bonzini (2013-08-12 02:30:28) 1) rename AioContext

Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers

2013-08-20 Thread Wenchao Xia
于 2013-8-20 17:29, Alex Bligh 写道: On 20 Aug 2013, at 08:19, Wenchao Xia wrote: Thanks for the explanation. It seems *timeout is always set to -1 before calling GSource's prepare(), so *timeout = qemu_soonest_timeout(*timeout, 10); will always get *timeout = 10, so this call can be saved

Re: [Qemu-devel] [PATCHv11 13/31] aio / timers: aio_ctx_prepare sets timeout from AioContext timers

2013-08-19 Thread Wenchao Xia
false; } @@ -180,7 +189,7 @@ aio_ctx_check(GSource *source) return true; } } -return aio_pending(ctx); +return aio_pending(ctx) || (timerlistgroup_deadline_ns(ctx-tlg) == 0); } static gboolean -- Best Regards Wenchao Xia

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-16 Thread Wenchao Xia
于 2013-8-16 0:32, Michael Roth 写道: Quoting Michael Roth (2013-08-15 10:23:20) Quoting Wenchao Xia (2013-08-13 03:44:39) 于 2013-8-13 1:01, Michael Roth 写道: Quoting Paolo Bonzini (2013-08-12 02:30:28) 1) rename AioContext to AioSource. This is my major purpose, which declare

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-16 Thread Wenchao Xia
于 2013-8-16 15:15, Wenchao Xia 写道: 于 2013-8-16 0:32, Michael Roth 写道: Quoting Michael Roth (2013-08-15 10:23:20) Quoting Wenchao Xia (2013-08-13 03:44:39) 于 2013-8-13 1:01, Michael Roth 写道: Quoting Paolo Bonzini (2013-08-12 02:30:28) 1) rename AioContext to AioSource. This is my major

Re: [Qemu-devel] [PATCH 7/9] iohandler: associate with main event loop via a QSource

2013-08-15 Thread Wenchao Xia
) slirp_update_timeout(timeout); slirp_pollfds_fill(gpollfds); #endif -qemu_iohandler_fill(gpollfds); ret = os_host_main_loop_wait(timeout); -qemu_iohandler_poll(gpollfds, ret); #ifdef CONFIG_SLIRP slirp_pollfds_poll(gpollfds, (ret 0)); #endif -- Best Regards Wenchao

Re: [Qemu-devel] [PATCH] Introduce cache images for the QCOW2 format

2013-08-15 Thread Wenchao Xia
. qemu-img create cache.img -b base.img qemu-img create vm1.img -b cache.img step 2: boot vm1, vm2: qemu -hda vm1.img -COR cache.img qemu -hda vm2.img -- Best Regards Wenchao Xia

Re: [Qemu-devel] Are there plans to achieve ram live Snapshot feature?

2013-08-15 Thread Wenchao Xia
于 2013-8-15 15:49, Stefan Hajnoczi 写道: On Thu, Aug 15, 2013 at 10:26:36AM +0800, Wenchao Xia wrote: 于 2013-8-14 15:53, Stefan Hajnoczi 写道: On Wed, Aug 14, 2013 at 3:54 AM, Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013-8-13 16:21, Stefan Hajnoczi 写道: On Tue, Aug 13, 2013 at 4:53 AM

Re: [Qemu-devel] [PATCH V7 0/8] add internal snapshot support at block device level

2013-08-15 Thread Wenchao Xia
于 2013-8-7 11:00, Wenchao Xia 写道: This series brings internal snapshot support at block devices level, now we have two three methods to do block snapshot lively: 1) backing chain, 2) internal one and 3) drive-back up approach. Comparation: Advantages

Re: [Qemu-devel] Are there plans to achieve ram live Snapshot feature?

2013-08-14 Thread Wenchao Xia
于 2013-8-14 15:53, Stefan Hajnoczi 写道: On Wed, Aug 14, 2013 at 3:54 AM, Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013-8-13 16:21, Stefan Hajnoczi 写道: On Tue, Aug 13, 2013 at 4:53 AM, Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013-8-12 19:33, Stefan Hajnoczi 写道: On Mon, Aug

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-13 Thread Wenchao Xia
, except as a GSource. I think expose GmainContext * or QContext *, is better than GSource *. int bdrv_read(GMainContext *ctx, BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors) Paolo -- Best Regards Wenchao Xia

Re: [Qemu-devel] Are there plans to achieve ram live Snapshot feature?

2013-08-13 Thread Wenchao Xia
于 2013-8-13 16:21, Stefan Hajnoczi 写道: On Tue, Aug 13, 2013 at 4:53 AM, Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013-8-12 19:33, Stefan Hajnoczi 写道: On Mon, Aug 12, 2013 at 12:26 PM, Alex Bligh a...@alex.org.uk wrote: --On 12 August 2013 11:59:03 +0200 Stefan Hajnoczi stefa

Re: [Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-12 Thread Wenchao Xia
Il 10/08/2013 05:24, Wenchao Xia ha scritto: Hi folks, I'd like form a series which remove AioContext's concept and bind to glib's main loop more closely. Since changed place will be a bit much so want to know your opinion before real coding: I'm not sure I understand... What does

Re: [Qemu-devel] [RFC] [PATCHv8 09/30] aio / timers: Add QEMUTimerListGroup and helper functions

2013-08-12 Thread Wenchao Xia
ways to go here: 1. Wrap TimerListGroup into a separate struct, leave all the TimerListGroup functions in. This probably makes it easier if (for instance) we decided to get rid of AioContexts entirely and make them g_source subclasses (per Wenchao Xia). I have a quick view

Re: [Qemu-devel] Are there plans to achieve ram live Snapshot feature?

2013-08-12 Thread Wenchao Xia
Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v6 00/18] aio: drop io_flush()

2013-08-09 Thread Wenchao Xia
| 11 +- 19 files changed, 163 insertions(+), 288 deletions(-) Ping? I tried to apply this series to do more work above it, but seems code conflict with upstream. -- Best Regards Wenchao Xia

[Qemu-devel] [RFC] Convert AioContext to Gsource sub classes

2013-08-09 Thread Wenchao Xia
API to run the event loop. But If I got glib's GmainContext, things become simple. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v6 01/18] block: ensure bdrv_drain_all() works during bdrv_delete()

2013-08-06 Thread Wenchao Xia
On Fri, Jul 26, 2013 at 02:43:44PM +0800, Wenchao Xia wrote: Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com One question: old code missed itself in bdrv_drain_all(), is that a bug? Sorry, I don't understand the question. Can you rephrase it? Before this patch, in the code path

[Qemu-devel] [PATCH V7 8/8] qemu-iotests: add 057 internal snapshot for block device test case

2013-08-06 Thread Wenchao Xia
Create in transaction and deletion in single command will be tested. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/057 | 259 tests/qemu-iotests/057.out |5 + tests/qemu-iotests/group |1 + 3 files changed

[Qemu-devel] [PATCH V7 2/8] snapshot: distinguish id and name in snapshot delete

2013-08-06 Thread Wenchao Xia
for *errp is based on Pavel's patch. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Signed-off-by: Pavel Hrdina phrd...@redhat.com --- block/qcow2-snapshot.c| 55 ++ block/qcow2.h |5 +++- block/rbd.c | 21

Re: [Qemu-devel] [PATCH V6 0/8] add internal snapshot support at block device level

2013-08-06 Thread Wenchao Xia
于 2013-7-30 10:59, Wenchao Xia 写道: This series brings internal snapshot support at block devices level, now we have two three methods to do block snapshot lively: 1) backing chain, 2) internal one and 3) drive-back up approach. Comparation: Advantages

[Qemu-devel] [PATCH V7 5/8] qmp: add interface blockdev-snapshot-delete-internal-sync

2013-08-06 Thread Wenchao Xia
for internal snapshot at block device level, but still possible in qemu-img. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c| 61 + include/qemu-common.h |3 ++ qapi-schema.json | 27 + qmp

[Qemu-devel] [PATCH V7 3/8] qmp: add internal snapshot support in qmp_transaction

2013-08-06 Thread Wenchao Xia
-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c | 116 ++ qapi-schema.json | 19 - qmp-commands.hx | 34 3 files changed, 160 insertions(+), 9 deletions(-) diff --git a/blockdev.c b/blockdev.c index 41b0a49

[Qemu-devel] [PATCH V7 6/8] hmp: add interface hmp_snapshot_blkdev_internal

2013-08-06 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp-commands.hx | 19 +-- hmp.c | 10 ++ hmp.h |1 + 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 8c6b91a..039c401 100644

[Qemu-devel] [PATCH V7 4/8] qmp: add interface blockdev-snapshot-internal-sync

2013-08-06 Thread Wenchao Xia
Snapshot ID can't be specified in this interface. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c | 13 + qapi-schema.json | 20 qmp-commands.hx | 29 + 3 files changed, 62 insertions(+), 0 deletions

[Qemu-devel] [PATCH V7 7/8] hmp: add interface hmp_snapshot_delete_blkdev_internal

2013-08-06 Thread Wenchao Xia
It is hard to make both id and name optional in hmp console as qmp interface, so this interface require user to specify name. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp-commands.hx | 18 ++ hmp.c | 12 hmp.h |1 + 3

[Qemu-devel] [PATCH V7 0/8] add internal snapshot support at block device level

2013-08-06 Thread Wenchao Xia
of bdrv_snapshot_find_by_id_and_name(). Other: 2/8: refined the comments in code for bdrv_snapshot_delete(). 3/8: in error reporting, change format from reason is: '%s' to reason is: %s. v7: rebased on upstream, target for 1.7. Wenchao Xia (8): 1 snapshot: new function

[Qemu-devel] [PATCH V7 1/8] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-08-06 Thread Wenchao Xia
To make it clear about id and name in searching, add this API to distinguish them. Caller can choose to search by id or name, *errp will be set only for exception. Some code are modified based on Pavel's patch. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Signed-off-by: Pavel Hrdina

Re: [Qemu-devel] [PATCH v3 1/7] vvfat: use bdrv_new() to allocate BlockDriverState

2013-08-02 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com we need bdrv_new() to properly initialize BDS, don't allocate memory manually. Signed-off-by: Fam Zheng f...@redhat.com --- block/vvfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vvfat.c b/block

Re: [Qemu-devel] [PATCH v3 2/7] iscsi: use bdrv_new() instead of stack structure

2013-08-02 Thread Wenchao Xia
@@ out: if (iscsilun-iscsi != NULL) { iscsi_destroy_context(iscsilun-iscsi); } -g_free(bs.opaque); bs,opaque seems leaked. bdrv_delete() will not free it unless bs-drv != NULL. +bdrv_delete(bs); return ret; } -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v3 3/7] block: implement reference count for BlockDriverState

2013-08-02 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Introduce bdrv_ref/bdrv_unref to manage the lifecycle of BlockDriverState. They are unused for now but will used to replace bdrv_delete() later. Signed-off-by: Fam Zheng f...@redhat.com --- block.c | 21

Re: [Qemu-devel] [PATCH v3 4/7] block: make bdrv_delete() static

2013-08-02 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v3 5/7] migration: omit drive ref as we have bdrv_ref now

2013-08-02 Thread Wenchao Xia
(block_mig_state.bmds_list, entry); bdrv_set_in_use(bmds-bs, 0); -drive_put_ref(drive_get_by_blockdev(bmds-bs)); +bdrv_unref(bmds-bs); g_free(bmds-aio_bitmap); g_free(bmds); } -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v3 6/7] xen_disk: simplify blk_disconnect with refcnt

2013-08-02 Thread Wenchao Xia
); -} +bdrv_detach_dev(blkdev-bs, blkdev); +bdrv_unref(blkdev-bs); blkdev-bs = NULL; } xen_be_unbind_evtchn(blkdev-xendev); -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v3 7/7] nbd: use BlockDriverState refcnt

2013-08-02 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Previously, nbd calls drive_get_ref() on the drive of bs. A BDS doesn't always have associated dinfo, which nbd doesn't care either. We already have BDS ref count, so use it to make it safe for a BDS w/o blockdev. Signed-off-by: Fam Zheng

Re: [Qemu-devel] [PATCH V8 00/13] monitor: support sub command group in auto completion and help

2013-07-30 Thread Wenchao Xia
于 2013-7-31 0:03, Luiz Capitulino 写道: On Fri, 26 Jul 2013 11:20:29 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com 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

Re: [Qemu-devel] [PATCH V8 09/13] monitor: support sub command in help

2013-07-30 Thread Wenchao Xia
于 2013-7-30 22:51, Luiz Capitulino 写道: On Fri, 26 Jul 2013 11:20:38 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: The old code in help_cmd() uses global 'info_cmds' and treats it as a special case. Actually 'info_cmds' is a sub command group of 'mon_cmds', in order to avoid direct use

Re: [Qemu-devel] [PATCH v6 02/18] block: stop relying on io_flush() in bdrv_drain_all()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v6 03/18] dataplane/virtio-blk: check exit conditions before aio_poll()

2013-07-29 Thread Wenchao Xia
) { VirtIOBlockDataPlane *s = opaque; -do { +while (!s-stopping || s-num_reqs 0) { aio_poll(s-ctx, true); -} while (!s-stopping || s-num_reqs 0); +} return NULL; } It seems more likely a bug fix. Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com -- Best

Re: [Qemu-devel] [PATCH v6 04/18] tests: adjust test-aio to new aio_poll() semantics

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com aio_poll(ctx, true) will soon block if any fd handlers have been set. Previously it would only block when .io_flush() returned true. This means that callers must check their wait condition *before* aio_poll() to avoid deadlock. Reviewed

Re: [Qemu-devel] [PATCH v6 05/18] tests: adjust test-thread-pool to new aio_poll() semantics

2013-07-29 Thread Wenchao Xia
I am confused for sometime about the reason of the change, I think it can be concluded as: The meaning of aio_poll() will be changed, so change the caller in this test case. Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com aio_poll(ctx, true) will soon block when fd handlers have been set

Re: [Qemu-devel] [PATCH v6 06/18] aio: stop using .io_flush()

2013-07-29 Thread Wenchao Xia
...@redhat.com --- aio-posix.c | 29 + aio-win32.c | 34 ++ tests/test-aio.c | 10 +- 3 files changed, 28 insertions(+), 45 deletions(-) -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v6 07/18] block/curl: drop curl_aio_flush()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com .io_flush() is no longer called so drop curl_aio_flush(). The acb[] array that the function checks is still used in other parts of block/curl.c. Therefore we cannot remove acb[], it is needed. Signed-off-by: Stefan Hajnoczi stefa

Re: [Qemu-devel] [PATCH v6 08/18] block/gluster: drop qemu_gluster_aio_flush_cb()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Since .io_flush() is no longer called we do not need qemu_gluster_aio_flush_cb() anymore. It turns out that qemu_aio_count is unused now and can be dropped. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/gluster.c | 16

Re: [Qemu-devel] [PATCH v6 09/18] block/iscsi: drop iscsi_process_flush()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com .io_flush() is no longer called so drop iscsi_process_flush(). Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/iscsi.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/block/iscsi.c b/block

Re: [Qemu-devel] [PATCH v6 11/18] block/nbd: drop nbd_have_request()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com .io_flush() is no longer called so drop nbd_have_request(). We cannot drop in_flight since it is still used by other block/nbd.c code. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/nbd.c | 13 +++-- 1 file

Re: [Qemu-devel] [PATCH v6 10/18] block/linux-aio: drop qemu_laio_completion_cb()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com .io_flush() is no longer called so drop qemu_laio_completion_cb(). It turns out that count is now unused so drop that too. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/linux-aio.c | 17 ++--- 1 file

Re: [Qemu-devel] [PATCH v6 12/18] block/rbd: drop qemu_rbd_aio_flush_cb()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com .io_flush() is no longer called so drop qemu_rbd_aio_flush_cb(). qemu_aio_count is unused now so drop it too. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com --- block/rbd.c | 14 +- 1 file changed, 1 insertion(+), 13

Re: [Qemu-devel] [PATCH v6 04/18] tests: adjust test-aio to new aio_poll() semantics

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com aio_poll(ctx, true) will soon block if any fd handlers have been set. Previously it would only block when .io_flush() returned true. This means that callers must check their wait condition *before* aio_poll() to avoid deadlock. Reviewed

<    2   3   4   5   6   7   8   9   10   11   >