[Qemu-devel] [PATCH V5 10/10] qapi script: do not add "_" for every capitalized char in enum

2013-12-19 Thread Wenchao Xia
Now "enum AIOContext" will generate AIO_CONTEXT instead of A_I_O_CONTEXT, "X86CPU" will generate X86_CPU instead of X86_C_P_U. Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- include/qapi/qmp/qerror.h |2 +- scripts/qapi.py | 26 +++

[Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd

2013-07-17 Thread Wenchao Xia
ort at block device level http://lists.nongnu.org/archive/html/qemu-devel/2013-07/msg01831.html Wenchao Xia (4): 1 snapshot: distinguish id and name in load_tmp 2 qemu-nbd: support internal snapshot export 3 qemu-nbd: add doc for internal snapshot export 4 qemu-iotests: add 057 internal snap

[Qemu-devel] [PATCH 2/4] qemu-nbd: support internal snapshot export

2013-07-17 Thread Wenchao Xia
Now it is possible to directly export an internal snapshot, which can be used to probe the snapshot's contents without qemu-img convert. Signed-off-by: Wenchao Xia --- qemu-nbd.c | 54 +- 1 files changed, 53 insertions(+), 1 dele

[Qemu-devel] [PATCH 3/4] qemu-nbd: add doc for internal snapshot export

2013-07-17 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- qemu-nbd.c|2 ++ qemu-nbd.texi |3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 46be2b2..833 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -80,6 +80,8 @@ static void usage(const char *name) "

[Qemu-devel] [PATCH 4/4] qemu-iotests: add 057 internal snapshot export with qemu-nbd case

2013-07-17 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- tests/qemu-iotests/057 | 87 tests/qemu-iotests/057.out | 26 + tests/qemu-iotests/group |1 + 3 files changed, 114 insertions(+), 0 deletions(-) create mode 100755 tests/qemu-iotests/057

[Qemu-devel] [PATCH 1/4] snapshot: distinguish id and name in load_tmp

2013-07-17 Thread Wenchao Xia
Since later this function will be used so improve it. The only caller of it now is qemu-img, and it is not impacted by call the function twice to keep old search logic. Signed-off-by: Wenchao Xia --- block/qcow2-snapshot.c| 16 ++-- block/qcow2.h |5

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

2013-07-17 Thread Wenchao Xia
于 2013-7-18 3:34, Luiz Capitulino 写道: On Thu, 11 Jul 2013 11:13:41 +0800 Wenchao Xia wrote: 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 t

Re: [Qemu-devel] [PATCH V6 08/13] monitor: refine parse_cmdline()

2013-07-17 Thread Wenchao Xia
于 2013-7-18 3:39, Luiz Capitulino 写道: On Thu, 11 Jul 2013 11:13:44 +0800 Wenchao Xia wrote: Since this function will be used by help_cmd() later, so improve it to make it more generic and easier to use. free_cmdline_args() is added to as paired function to free the result. Signed-off-by

Re: [Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd

2013-07-17 Thread Wenchao Xia
于 2013-7-17 23:21, Kevin Wolf 写道: Am 17.07.2013 um 16:23 hat Eric Blake geschrieben: On 07/17/2013 08:03 AM, Wenchao Xia wrote: This series allow user to read internal snapshot's contents without qemu-img convert. Another purpose is that, when qemu is online and have taken an internal sna

Re: [Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd

2013-07-18 Thread Wenchao Xia
于 2013-7-17 22:23, Eric Blake 写道: On 07/17/2013 08:03 AM, Wenchao Xia wrote: This series allow user to read internal snapshot's contents without qemu-img convert. Another purpose is that, when qemu is online and have taken an internal snapshot, let user invoke qemu-nbd to do any thing

Re: [Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd

2013-07-19 Thread Wenchao Xia
于 2013-7-18 13:43, Stefan Hajnoczi 写道: On Wed, Jul 17, 2013 at 10:03:51PM +0800, Wenchao Xia wrote: This series allow user to read internal snapshot's contents without qemu-img convert. Another purpose is that, when qemu is online and have taken an internal snapshot, let user invoke qemu-n

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

2013-07-19 Thread Wenchao Xia
于 2013-7-18 19:07, Stefan Hajnoczi 写道: On Thu, Jul 11, 2013 at 01:46:58PM +0800, Wenchao Xia wrote: diff --git a/include/qemu-common.h b/include/qemu-common.h index f439738..06c777f 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -191,6 +191,9 @@ int64_t strtosz_suffix(const

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

2013-07-19 Thread Wenchao Xia
于 2013-7-18 19:48, Kevin Wolf 写道: Am 11.07.2013 um 07:46 hat Wenchao Xia geschrieben: Snapshot creation actually already distinguish id and name since it take a structured parameter *sn, but delete can't. Later an accurate delete is needed in qmp_transaction abort and blockdev-snapshot-d

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

2013-07-19 Thread Wenchao Xia
于 2013-7-18 20:22, Kevin Wolf 写道: Am 11.07.2013 um 07:46 hat Wenchao Xia geschrieben: Unlike savevm, the qmp_transaction interface will not generate snapshot name automatically, saving trouble to return information of the new created snapshot. Although qcow2 support storing multiple snapshots

Re: [Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd

2013-07-19 Thread Wenchao Xia
于 2013-7-19 17:19, Kevin Wolf 写道: Am 19.07.2013 um 11:03 hat Wenchao Xia geschrieben: 于 2013-7-18 13:43, Stefan Hajnoczi 写道: On Wed, Jul 17, 2013 at 10:03:51PM +0800, Wenchao Xia wrote: This series allow user to read internal snapshot's contents without qemu-img convert. Another purpo

Re: [Qemu-devel] [PATCH v2 11/11] qmp: add command 'blockdev-backup'

2013-07-19 Thread Wenchao Xia
s with other transaction capabilities? Should be possible, as users may want point-in-time snapshot of multiple disks. If this API looks OK, I will include it into transaction in the next version. Instead of add this new API, how about extend Driver-backup API? This patch is basically doing similar things with driver-backup, extension of old API will save trouble to do same things driver-backup already does, such as support qmp_transaction. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v2 00/11] Point-in-time snapshot exporting over NBD

2013-07-19 Thread Wenchao Xia
old data to temporary file. Overall it seems good. Dirty change tracking is what miss for a full solution, which naturally exist in backing chain snapshot. > -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v2 00/17] Add qemu-img subcommand to dump file metadata

2013-07-19 Thread Wenchao Xia
mazVM80OyE52cNKAixUyLpJ7pR4fsF1mcswc BWdpSe/J8T6LRyTOAKoWoi2w8Mw/DMey4neQ1+py8tWuCqJix3NtyduVtsvrRiYd aPcXvGfAvDbzEcMHnwz0SVpTqleK/7H7pYScBdWYnmUG5wJuxfhJHD/5JDQ1wmj0 jGHmCAddWW+8RrHZGrpX =paUV -END PGP SIGNATURE----- -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v2 00/17] Add qemu-img subcommand to dump file metadata

2013-07-19 Thread Wenchao Xia
于 2013-7-19 20:14, Paolo Bonzini 写道: Il 19/07/2013 12:48, Wenchao Xia ha scritto: I think dump of allocated info in qemu-img in this series, can do dirty change tracking job for backing chain snapshot now, qemu's QMP interface is not very needed. Only thing not perfect, is that it

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

2013-07-19 Thread Wenchao Xia
于 2013-7-19 18:13, Kevin Wolf 写道: Am 19.07.2013 um 11:19 hat Wenchao Xia geschrieben: 于 2013-7-18 20:22, Kevin Wolf 写道: Am 11.07.2013 um 07:46 hat Wenchao Xia geschrieben: Unlike savevm, the qmp_transaction interface will not generate snapshot name automatically, saving trouble to return

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

2013-07-19 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- monitor.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index b88c02b..0f92bca 100644 --- a/monitor.c +++ b/monitor.c @@ -4030,7 +4030,7 @@ static void cmd_completion(Monitor *mon, const char *name, const

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

2013-07-19 Thread Wenchao Xia
Now help support sub command, so later if another sub 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 tr

[Qemu-devel] [PATCH V7 07/13] monitor: code move for parse_cmdline()

2013-07-19 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 --- monitor.c | 191 +++-- 1 files

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

2013-07-19 Thread Wenchao Xia
is not used any more. "help" 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 --- monitor.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git

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

2013-07-19 Thread Wenchao Xia
part into a separate function, make review easier. This also avoided re-parsing the command line which does in previous version. 11/13: splitted patch, which simply remove usage of info_cmds and support sub command by re-enter the function. v7: 5/13: moved the comments why the change is safe, to co

[Qemu-devel] [PATCH V7 10/13] monitor: refine monitor_find_completion()

2013-07-19 Thread Wenchao Xia
, which 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 --- monito

[Qemu-devel] [PATCH V7 12/13] monitor: allow "help" show message for single command in sub group

2013-07-19 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 --- hmp-commands.hx |2 +- monitor.c | 27 +++ 2 files changed, 28 insertions(+), 1 deletions(

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

2013-07-19 Thread Wenchao Xia
A new local variable *mon is added in monitor_find_completion() to make compile pass, which will be removed later in convertion patch for monitor_find_completion(). Signed-off-by: Wenchao Xia --- monitor.c | 13 +++-- 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a

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

2013-07-19 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 --- monitor.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index ea3ed96..95fa918 100644 -

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

2013-07-19 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- monitor.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index 0f92bca..10ebabc 100644 --- a/monitor.c +++ b/monitor.c @@ -4086,14 +4086,21 @@ static void file_completion(Monitor *mon, const char

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

2013-07-19 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 --- include/monitor/readline.h |3 ++- monito

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

2013-07-19 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

[Qemu-devel] [PATCH V7 08/13] monitor: refine parse_cmdline()

2013-07-19 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 --- monitor.c | 51 --- 1 fi

[Qemu-devel] [PATCH V7 06/13] monitor: avoid direct use of global variable *mon_cmds

2013-07-19 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

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

2013-07-20 Thread Wenchao Xia
于 2013-7-20 19:49, Eric Blake 写道: On 07/19/2013 07:44 PM, Wenchao Xia wrote: A new local variable *mon is added in monitor_find_completion() to make compile pass, which will be removed later in convertion patch for monitor_find_completion(). s/convertion/conversion/ Signed-off-by: Wenchao

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

2013-07-20 Thread Wenchao Xia
ove device info in error message when name is empty. Use else if after call 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

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

2013-07-20 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- 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 --- a/hmp-commands.hx +++ b/hmp

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

2013-07-20 Thread Wenchao Xia
ff-by: Wenchao Xia --- blockdev.c | 116 ++ qapi-schema.json | 18 - qmp-commands.hx | 34 3 files changed, 159 insertions(+), 9 deletions(-) diff --git a/blockdev.c b/blockdev.c index c5abd65..a38d83c 100644

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

2013-07-20 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 Signed-off-by: Pavel Hrdina --- block/snaps

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

2013-07-20 Thread Wenchao Xia
e for *errp is based on Pavel's patch. Signed-off-by: Wenchao Xia Signed-off-by: Pavel Hrdina --- block/qcow2-snapshot.c| 55 ++ block/qcow2.h |5 +++- block/rbd.c | 21 +++- block/sheepdog.c

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

2013-07-20 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 --- hmp-commands.hx | 18 ++ hmp.c | 12 hmp.h |1 + 3 files changed, 31 insertions

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

2013-07-20 Thread Wenchao Xia
w interface for internal snapshot at block device level, but still possible in qemu-img. Signed-off-by: Wenchao Xia --- blockdev.c| 61 + include/qemu-common.h |3 ++ qapi-schema.json | 27 + qmp-commands.

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

2013-07-20 Thread Wenchao Xia
Snapshot ID can't be specified in this interface. Signed-off-by: Wenchao Xia --- blockdev.c | 13 + qapi-schema.json | 20 qmp-commands.hx | 29 + 3 files changed, 62 insertions(+), 0 deletions(-) diff --git a/block

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

2013-07-20 Thread Wenchao Xia
Create in transaction and deletion in single command will be tested. Signed-off-by: Wenchao Xia --- tests/qemu-iotests/056 | 259 tests/qemu-iotests/056.out |5 + tests/qemu-iotests/group |1 + 3 files changed, 265 insertions(+), 0

Re: [Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd

2013-07-21 Thread Wenchao Xia
于 2013-7-22 10:10, Fam Zheng 写道: On Fri, 07/19 17:03, Wenchao Xia wrote: 于 2013-7-18 13:43, Stefan Hajnoczi 写道: On Wed, Jul 17, 2013 at 10:03:51PM +0800, Wenchao Xia wrote: This series allow user to read internal snapshot's contents without qemu-img convert. Another purpose is that, when

Re: [Qemu-devel] [PATCH V19 0/8] add-cow file format

2013-07-21 Thread Wenchao Xia
c | 15 +- > trace-events | 13 +- > 22 files changed, 1536 insertions(+), 451 deletions(-) > create mode 100644 block/add-cow.c > create mode 100644 block/block-cache.c > delete mode 100644 block/qcow2-cache.c > create mode 100644 docs/specs/add-cow.txt > create mode 100644 include/block/block-cache.h > To add dirty block tracking about block, I think add-cow file format will help, hope it can progress fast. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd

2013-07-21 Thread Wenchao Xia
Eric, I'd like to have a discuss about snapshot and vmbackup in qemu/libvirt with management stack's perspective, what is your time zone? I hope to ping you in IRC. On 07/17/2013 08:03 AM, Wenchao Xia wrote: This series allow user to read internal snapshot's contents without q

Re: [Qemu-devel] [PATCH 0/2] block: allow commit active as top

2013-07-21 Thread Wenchao Xia
s too much to make it work, maybe you can postpond it, since block-stream is available. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v2 00/11] Point-in-time snapshot exporting over NBD

2013-07-22 Thread Wenchao Xia
于 2013-7-19 18:41, Wenchao Xia 写道: > 于 2013-7-17 17:42, Fam Zheng 写道: >> This series adds for point-in-time snapshot NBD exporting based on >> blockdev-backup (variant of drive-backup with existing device as target). >> This >> patch is built on top of imain's sy

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

2013-07-24 Thread Wenchao Xia
于 2013-7-20 9:44, Wenchao Xia 写道: > 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

Re: [Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd

2013-07-24 Thread Wenchao Xia
Besides the argument, I think it helps to probe snapshot without qemu-img convert, hope to get comments for the code. -- Best Regards Wenchao Xia

Re: [Qemu-devel] RFC [PATCH] Make bdrv_flush synchronous only and update callers

2013-07-24 Thread Wenchao Xia
I am glad to have an accurate sync bdrv_flush(). Code looks fine. Reviewed-by: Wenchao Xia > This patch makes bdrv_flush a synchronous function and updates any callers > from > a coroutine context to use bdrv_co_flush instead. > > The motivation for this patch come

Re: [Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd

2013-07-25 Thread Wenchao Xia
于 2013-7-25 16:06, Stefan Hajnoczi 写道: On Thu, Jul 25, 2013 at 10:30:49AM +0800, Wenchao Xia wrote: Besides the argument, I think it helps to probe snapshot without qemu-img convert, hope to get comments for the code. Hi Wenchao, Which patch are you referring to? Stefan This series

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

2013-07-25 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 Reviewed-by: Eric Blake --- monitor.c | 13 +++-- 1 files changed, 7 insertions(+), 6

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

2013-07-25 Thread Wenchao Xia
Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- monitor.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index c2babba..dc66dca 100644 --- a/monitor.c +++ b/monitor.c @@ -4030,7 +4030,7 @@ static void cmd_completion(Monitor *mon

[Qemu-devel] [PATCH V8 07/13] monitor: code move for parse_cmdline()

2013-07-25 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 Reviewed-by: Eric Blake --- monitor.c | 191

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

2013-07-25 Thread Wenchao Xia
he comments why the change is safe, to cover-letter. 8/13: use assert in free_cmdline_args(), fail when args in input exceed the limit in parse_cmdline(). v8: Address Eric's comments: Fix typo in commit messages. Wenchao Xia (13): 1 monitor: avoid use of global *cur_mon in cmd_completion

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

2013-07-25 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

[Qemu-devel] [PATCH V8 10/13] monitor: refine monitor_find_completion()

2013-07-25 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 Reviewed-by: Eric Blake --- monito

[Qemu-devel] [PATCH V8 08/13] monitor: refine parse_cmdline()

2013-07-25 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 Reviewed-by: Eric Blake --- m

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

2013-07-25 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 Reviewed-by: Eric Blake --- include/moni

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

2013-07-25 Thread Wenchao Xia
Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- monitor.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index dc66dca..0ecb70a 100644 --- a/monitor.c +++ b/monitor.c @@ -4086,14 +4086,21 @@ static void file_completion

[Qemu-devel] [PATCH V8 06/13] monitor: avoid direct use of global variable *mon_cmds

2013-07-25 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

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

2013-07-25 Thread Wenchao Xia
is not used any more. "help" 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 Reviewed-by: Eric Blake --- monitor.c | 14 +++--- 1 files changed, 7 insertions(+)

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

2013-07-25 Thread Wenchao Xia
Now help supports sub command, so later if another sub 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 trea

[Qemu-devel] [PATCH V8 12/13] monitor: allow "help" show message for single command in sub group

2013-07-25 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 Reviewed-by: Eric Blake --- hmp-commands.hx |2 +- monitor.c | 27 +++ 2 files changed, 28 insert

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

2013-07-25 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 Reviewed-by: Eric Blake --- monitor.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index 99b

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

2013-07-25 Thread Wenchao Xia
>> >Luiz, do you like a respin for this version? There are some typo in > commit message Eric have pointed out. > I have respinned v8 to fix the typo issues, sorry for interrupt. -- Best Regards Wenchao Xia

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

2013-07-25 Thread Wenchao Xia
Reviewed-by: Wenchao Xia One question: old code missed itself in bdrv_drain_all(), is that a bug? > In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close() > so that the device is still seen by bdrv_drain_all() when iterating > bdrv_states. > > Cc: qemu-st

Re: [Qemu-devel] [PATCH 3/4] qemu-nbd: add doc for internal snapshot export

2013-07-28 Thread Wenchao Xia
于 2013-7-26 16:11, Stefan Hajnoczi 写道: > On Wed, Jul 17, 2013 at 10:03:54PM +0800, Wenchao Xia wrote: >> Signed-off-by: Wenchao Xia >> --- >> qemu-nbd.c|2 ++ >> qemu-nbd.texi |3 +++ >> 2 files changed, 5 insertions(+), 0 deletions(-) >>

Re: [Qemu-devel] [PATCH 0/4] export internal snapshot by qemu-nbd

2013-07-28 Thread Wenchao Xia
于 2013-7-26 16:20, Stefan Hajnoczi 写道: > On Fri, Jul 26, 2013 at 10:23:24AM +0800, Wenchao Xia wrote: >> 于 2013-7-25 16:06, Stefan Hajnoczi 写道: >>> On Thu, Jul 25, 2013 at 10:30:49AM +0800, Wenchao Xia wrote: >>>>Besides the argument, I think it helps to probe

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 -- 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
@@ static void *data_plane_thread(void *opaque) > { > 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

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 > 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. > > Revie

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 > aio_poll(ctx, true) will soon block when fd handlers have been set. > Pre

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

2013-07-29 Thread Wenchao Xia
n finally > drop the io_flush arguments to aio_set_fd_handler() and friends. > > Reviewed-by: Paolo Bonzini > Signed-off-by: Stefan Hajnoczi > --- > 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 > .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 > --- >

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 > 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 > --- > 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 > .io_flush() is no longer called so drop iscsi_process_flush(). > > Signed-off-by: Stefan Hajnoczi > --- > block/iscsi.c | 9 + > 1 file changed, 1 insertion(+), 8 deletions(-) > > diff --git a/block/iscsi.c b/block/iscsi.c > in

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

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia > .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 > --- > block/nbd.c | 13 +++-- > 1 file changed, 3 insert

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 > .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 > --- > block/linux-aio.c | 17 ++--- > 1 file changed, 2 insert

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 > .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 > --- > block/rbd.c | 14 +- > 1 file changed, 1 insertion(+), 13 deletions(-) &g

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 > 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. > > Revie

Re: [Qemu-devel] [PATCH v6 13/18] block/sheepdog: drop have_co_req() and aio_flush_request()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia > .io_flush() is no longer called so drop have_co_req() and > aio_flush_request(). > > Signed-off-by: Stefan Hajnoczi > --- > block/sheepdog.c | 25 + > 1 file changed, 5 insertions(+), 20 deletions(-) > > diff

Re: [Qemu-devel] [PATCH v6 14/18] block/ssh: drop return_true()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia > .io_flush() is no longer called so drop return_true(). > > Signed-off-by: Stefan Hajnoczi > --- > block/ssh.c | 10 +- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/block/ssh.c b/block/ssh.c > index d7e7

Re: [Qemu-devel] [PATCH v6 15/18] dataplane/virtio-blk: drop flush_true() and flush_io()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia > .io_flush() is no longer called so drop flush_true() and flush_io(). > > Signed-off-by: Stefan Hajnoczi > --- > hw/block/dataplane/virtio-blk.c | 17 ++--- > 1 file changed, 2 insertions(+), 15 deletions(-) > > diff --git a/h

Re: [Qemu-devel] [PATCH v6 16/18] thread-pool: drop thread_pool_active()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia > .io_flush() is no longer called so drop thread_pool_active(). The block > layer is the only thread-pool.c user and it already tracks in-flight > requests, therefore we do not need thread_pool_active(). > > Signed-off-by: Stefan Hajnoczi > --- >

Re: [Qemu-devel] [PATCH v6 17/18] tests: drop event_active_cb()

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia > Drop the io_flush argument to aio_set_event_notifier(). > > Reviewed-by: Paolo Bonzini > Signed-off-by: Stefan Hajnoczi > --- > tests/test-aio.c | 22 -- > 1 file changed, 8 insertions(+), 14 deletions(-) > > diff

Re: [Qemu-devel] [PATCH v6 18/18] aio: drop io_flush argument

2013-07-29 Thread Wenchao Xia
Reviewed-by: Wenchao Xia > The .io_flush() handler no longer exists and has no users. Drop the > io_flush argument to aio_set_fd_handler() and related functions. > > The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no > longer used and are dropped too. > &g

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

2013-07-29 Thread Wenchao Xia
ded > to make the usage clear while keep logic unchanged. >3/8: remove device info in error message when name is empty. Use else if > after call of bdrv_snapshot_find_by_id_and_name(). >Other: >2/8: refined the comments in code for bdrv_snapshot_delete(). >3/8: in e

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 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

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 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

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

2013-08-02 Thread Wenchao Xia
Reviewed-by: Wenchao Xia > we need bdrv_new() to properly initialize BDS, don't allocate memory > manually. > > Signed-off-by: Fam Zheng > --- > 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
: > 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 > 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 > --- > 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 -- 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
_mig_cleanup(void) > while ((bmds = QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) != NULL) { > QSIMPLEQ_REMOVE_HEAD(&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
eated it ourself */ > -bdrv_close(blkdev->bs); > -bdrv_detach_dev(blkdev->bs, blkdev); > -bdrv_unref(blkdev->bs); > -} > +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 > 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 Z

Re: [Qemu-devel] [PATCH V3 1/4] block: drop bs_snapshots global variable

2013-05-29 Thread Wenchao Xia
于 2013-5-28 15:46, Stefan Hajnoczi 写道: On Mon, May 27, 2013 at 05:25:16PM +0200, Kevin Wolf wrote: Am 25.05.2013 um 05:09 hat Wenchao Xia geschrieben: From: Stefan Hajnoczi The bs_snapshots global variable points to the BlockDriverState which will be used to save vmstate. This is really a

<    11   12   13   14   15   16   17   18   >