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

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

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

2013-07-10 Thread Wenchao Xia
-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c | 117 ++ qapi-schema.json | 18 - qmp-commands.hx | 34 3 files changed, 160 insertions(+), 9 deletions(-) diff --git a/blockdev.c b/blockdev.c index b3a57e0

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

2013-07-10 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 V5 7/8] hmp: add interface hmp_snapshot_delete_blkdev_internal

2013-07-10 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 V5 8/8] qemu-iotests: add 056 internal snapshot for block device test case

2013-07-10 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/056 | 259 tests/qemu-iotests/056.out |5 + tests/qemu-iotests/group |1 + 3 files changed

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

2013-07-10 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 ++ qapi-schema.json | 27 +++ qmp-commands.hx | 41

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

2013-07-10 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 d1cdcfb..ec613e8 100644

Re: [Qemu-devel] [PATCH V5 1/7] monitor: avoid direct use of global *cur_mon in completion functions

2013-07-09 Thread Wenchao Xia
Wenchao Xia

[Qemu-devel] [PATCH V4 1/9] snapshot: new function bdrv_snapshot_find_by_id_and_name()

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

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

2013-07-08 Thread Wenchao Xia
Stefan's comments: 4/9: use error_setg_errno() to show error reason for bdrv_snapshot_create(), spell fix and better doc. 5/9: better doc. 6/9: remove spurious ';' in code, spell fix and better doc. Wenchao Xia (9): 1 snapshot: new function bdrv_snapshot_find_by_id_and_name() 2 snapshot: add

[Qemu-devel] [PATCH V4 2/9] snapshot: add paired functions for internal snapshot id and name

2013-07-08 Thread Wenchao Xia
be also taken in qcow2_snapshot_create(), but require it to return error reason. For rbd, it have no ID, so have no impact. For sheepdog, ID can't be determined in qemu, so still can't guarantee that no more conflict for ID and name. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block

[Qemu-devel] [PATCH V4 7/9] hmp: add interface hmp_snapshot_blkdev_internal

2013-07-08 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 915b0d1..53e3ef3 100644

[Qemu-devel] [PATCH V4 3/9] snapshot: distinguish id and name in snapshot delete

2013-07-08 Thread Wenchao Xia
. For sheepdog, it does nothing. After this patch: For qcow2, logic is the same by call it twice in caller. For rbd, it always fails in delete with id, but still search for name in second try, no change for user. Some code for *errp is based on Pavel's patch. Signed-off-by: Wenchao Xia xiaw

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

2013-07-08 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/056 | 267 tests/qemu-iotests/056.out |5 + tests/qemu-iotests/group |1 + 3 files changed

[Qemu-devel] [PATCH V4 4/9] qmp: add internal snapshot support in qmp_transaction

2013-07-08 Thread Wenchao Xia
in this interface. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c | 120 ++ qapi-schema.json | 18 - qmp-commands.hx | 34 --- 3 files changed, 164 insertions(+), 8 deletions(-) diff --git

[Qemu-devel] [PATCH V4 8/9] hmp: add interface hmp_snapshot_delete_blkdev_internal

2013-07-08 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 V4 5/9] qmp: add interface blockdev-snapshot-internal-sync

2013-07-08 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 | 22 ++ qmp-commands.hx | 30 ++ 3 files changed, 65 insertions(+), 0

[Qemu-devel] [PATCH V4 6/9] qmp: add interface blockdev-snapshot-delete-internal-sync

2013-07-08 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 ++ qapi-schema.json | 27 +++ qmp-commands.hx | 41

Re: [Qemu-devel] [PATCH V5 1/7] monitor: avoid direct use of global *cur_mon in completion functions

2013-07-08 Thread Wenchao Xia
于 2013-7-8 23:17, Luiz Capitulino 写道: On Sat, 29 Jun 2013 11:52:55 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: Parameter *mon is added to replace *cur_mon, and readline_completion() pass rs-mon as value, which should be initialized in readline_init() called by monitor_init(). In short

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

2013-07-07 Thread Wenchao Xia
于 2013-7-4 20:44, Stefan Hajnoczi 写道: On Wed, Jul 03, 2013 at 09:52:10AM +0800, Wenchao Xia wrote: Any comments for this version? I'm happy with the code and left comments on error messages and documentation. Thanks for your review :), fix is on the way. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V5 0/7] monitor: support sub command group in auto completion and help

2013-07-07 Thread Wenchao Xia
around for () in old code, add min(nb_args, MAX_ARGS) in free to make code stronger. v5: 4/7: use a b ? a : b instead of macro min. Wenchao Xia (7): 1 monitor: avoid direct use of global *cur_mon in completion functions 2 monitor: avoid direct use of global variable *mon_cmds

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

2013-07-02 Thread Wenchao Xia
vm_clock. 9/9: better doc, refined the code and add more test case. Wenchao Xia (9): 1 snapshot: new function bdrv_snapshot_find_by_id_and_name() 2 snapshot: add paired functions for internal snapshot id and name 3 snapshot: distinguish id and name in snapshot delete 4 qmp

Re: [Qemu-devel] [PATCH V4 0/7] monitor: support sub command group in auto completion and help

2013-06-28 Thread Wenchao Xia
于 2013-6-28 11:39, Wenchao Xia 写道: Global variable *mon_cmds and *info_cmds are not directly used any more, *cur_mon is not used in completion related functions. It is possible to create a monitor with different command table now, but that requirement do not exist yet, so not changed

[Qemu-devel] [PATCH V5 0/7] monitor: support sub command group in auto completion and help

2013-06-28 Thread Wenchao Xia
stronger. v5: 4/7: use a b ? a : b instead of macro min. Wenchao Xia (7): 1 monitor: avoid direct use of global *cur_mon in completion functions 2 monitor: avoid direct use of global variable *mon_cmds 3 monitor: code move for parse_cmdline() 4 monitor: avoid direct use of global

[Qemu-devel] [PATCH V5 4/7] monitor: avoid direct use of global *info_cmds in help functions

2013-06-28 Thread Wenchao Xia
as special help case. compare_cmd() is used instead of strcmp() in command searching. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c | 63 +++- 1 files changed, 53 insertions(+), 10 deletions(-) diff --git a/monitor.c b

[Qemu-devel] [PATCH V5 1/7] monitor: avoid direct use of global *cur_mon in completion functions

2013-06-28 Thread Wenchao Xia
Parameter *mon is added to replace *cur_mon, and readline_completion() pass rs-mon as value, which should be initialized in readline_init() called by monitor_init(). In short, structure ReadLineState controls where the action would be taken now. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V5 2/7] monitor: avoid direct use of global variable *mon_cmds

2013-06-28 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 V5 3/7] monitor: code move for parse_cmdline()

2013-06-28 Thread Wenchao Xia
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 --- monitor.c | 191 +++-- 1 files changed, 98 insertions

[Qemu-devel] [PATCH V5 7/7] monitor: improve help to allow show details of single command in sub group

2013-06-28 Thread Wenchao Xia
A new parameter type 'S' is introduced to allow user input any string. help info block do not tip extra parameter error now. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp-commands.hx |2 +- monitor.c | 30 +- 2 files changed, 30 insertions

[Qemu-devel] [PATCH V5 5/7] monitor: support sub commands in auto completion

2013-06-28 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. parse_cmdline() takes another parameter now to tell next valid parameter's position in original cmdline. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH V5 6/7] monitor: improve help in auto completion for sub command

2013-06-28 Thread Wenchao Xia
Now special case help * in auto completion can work with sub commands, such as help info a*. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index 2f5b91d..3ef18ee 100644

Re: [Qemu-devel] [RFC] qemu-img: add option -d in convert

2013-06-27 Thread Wenchao Xia
于 2013-6-27 17:01, Stefan Hajnoczi 写道: On Tue, Jun 25, 2013 at 07:14:19PM +0800, Wenchao Xia wrote: 于 2013-6-25 17:13, Stefan Hajnoczi 写道: On Thu, Jun 20, 2013 at 04:59:17PM +0800, Wenchao Xia wrote: If I understand correctly, you have a backing chain with internal snapshots: imageA(sn0

Re: [Qemu-devel] [RFC] qemu-img: add option -d in convert

2013-06-27 Thread Wenchao Xia
于 2013-6-27 17:01, Stefan Hajnoczi 写道: On Tue, Jun 25, 2013 at 07:14:19PM +0800, Wenchao Xia wrote: 于 2013-6-25 17:13, Stefan Hajnoczi 写道: On Thu, Jun 20, 2013 at 04:59:17PM +0800, Wenchao Xia wrote: If I understand correctly, you have a backing chain with internal snapshots: imageA(sn0

Re: [Qemu-devel] [PATCH V3 1/7] monitor: discard global variable *cur_mon in completion functions

2013-06-27 Thread Wenchao Xia
于 2013-6-28 5:26, Eric Blake 写道: On 06/26/2013 09:27 PM, Wenchao Xia wrote: Parameter *mon is added to replace *cur_mon, and readline_completion() pass rs-mon as value, which should be initialized in readline_init() called by monitor_init(). In short, structure ReadLineState controls where

[Qemu-devel] [PATCH V4 3/7] monitor: code move for parse_cmdline()

2013-06-27 Thread Wenchao Xia
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 --- monitor.c | 191 +++-- 1 files changed, 98 insertions

[Qemu-devel] [PATCH V4 1/7] monitor: avoid direct use of global *cur_mon in completion functions

2013-06-27 Thread Wenchao Xia
Parameter *mon is added to replace *cur_mon, and readline_completion() pass rs-mon as value, which should be initialized in readline_init() called by monitor_init(). In short, structure ReadLineState controls where the action would be taken now. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V4 2/7] monitor: avoid direct use of global variable *mon_cmds

2013-06-27 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 V4 0/7] monitor: support sub command group in auto completion and help

2013-06-27 Thread Wenchao Xia
stronger. Wenchao Xia (7): 1 monitor: avoid direct use of global *cur_mon in completion functions 2 monitor: avoid direct use of global variable *mon_cmds 3 monitor: code move for parse_cmdline() 4 monitor: avoid direct use of global *info_cmds in help functions 5 monitor: support sub

[Qemu-devel] [PATCH V4 5/7] monitor: support sub commands in auto completion

2013-06-27 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. parse_cmdline() takes another parameter now to tell next valid parameter's position in original cmdline. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH V4 4/7] monitor: avoid direct use of global *info_cmds in help functions

2013-06-27 Thread Wenchao Xia
as special help case. compare_cmd() is used instead of strcmp() in command searching. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c | 63 +++- 1 files changed, 53 insertions

[Qemu-devel] [PATCH V4 6/7] monitor: improve help in auto completion for sub command

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

[Qemu-devel] [PATCH V4 7/7] monitor: improve help to allow show details of single command in sub group

2013-06-27 Thread Wenchao Xia
A new parameter type 'S' is introduced to allow user input any string. help info block do not tip extra parameter error now. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp-commands.hx |2 +- monitor.c | 30 +- 2 files changed, 30 insertions

Re: [Qemu-devel] [PATCH V2 5/7] monitor: support sub commands in auto completion

2013-06-26 Thread Wenchao Xia
于 2013-6-27 0:03, Luiz Capitulino 写道: On Wed, 26 Jun 2013 12:03:39 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013-6-24 20:48, Wenchao Xia 写道: This patch allow auot completion work normal in sub command case, info block [DEVICE] can auto complete now, by re-enter the completion

[Qemu-devel] [PATCH V3 5/7] monitor: support sub commands in auto completion

2013-06-26 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. parse_cmdline() takes another parameter now to tell next valid parameter's position in original cmdline. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH V3 0/7] monitor: support sub command group in auto completion and help

2013-06-26 Thread Wenchao Xia
. Wenchao Xia (7): 1 monitor: discard global variable *cur_mon in completion functions 2 monitor: discard global variable *mon_cmds 3 monitor: discard global variable *info_cmds in help functions 4 monitor: code move for parse_cmdline() 5 monitor: support sub commands in auto completion 6

[Qemu-devel] [PATCH V3 1/7] monitor: discard global variable *cur_mon in completion functions

2013-06-26 Thread Wenchao Xia
Parameter *mon is added to replace *cur_mon, and readline_completion() pass rs-mon as value, which should be initialized in readline_init() called by monitor_init(). In short, structure ReadLineState controls where the action would be taken now. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V3 3/7] monitor: discard global variable *info_cmds in help functions

2013-06-26 Thread Wenchao Xia
as special help case. compare_cmd() is used instead of strcmp() in command searching. To tip better what the patch does, code moving is avoided by declare parse_cmdline() ahead. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c | 67

[Qemu-devel] [PATCH V3 2/7] monitor: discard global variable *mon_cmds

2013-06-26 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 V3 7/7] monitor: improve help to allow show tip of single command in sub group

2013-06-26 Thread Wenchao Xia
A new parameter type 'S' is introduced to allow user input any string. help info block do not tip extra parameter error now. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp-commands.hx |2 +- monitor.c | 30 +- 2 files changed, 30 insertions

[Qemu-devel] [PATCH V3 4/7] monitor: code move for parse_cmdline()

2013-06-26 Thread Wenchao Xia
Also fix code style error reported by check script. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c | 186 +++-- 1 files changed, 94 insertions(+), 92 deletions(-) diff --git a/monitor.c b/monitor.c index 54fc36f

[Qemu-devel] [PATCH V3 6/7] monitor: improve help in auto completion for sub command

2013-06-26 Thread Wenchao Xia
Now special case help * in auto completion can work with sub commands, such as help info a*. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index e0a4b67..1126540 100644

Re: [Qemu-devel] [RFC] qemu-img: add option -d in convert

2013-06-25 Thread Wenchao Xia
于 2013-6-25 17:13, Stefan Hajnoczi 写道: On Thu, Jun 20, 2013 at 04:59:17PM +0800, Wenchao Xia wrote: If I understand correctly, you have a backing chain with internal snapshots: imageA(sn0)-imageB(sn0,sn1)-imageC(sn0) And you want to convert this to a chain of external snapshots: What

[Qemu-devel] [PATCH V3 2/9] snapshot: add paired functions for internal snapshot id and name

2013-06-25 Thread Wenchao Xia
be also taken in qcow2_snapshot_create(), but require it to return error reason. For rbd, it have no ID, so have no impact. For sheepdog, ID can't be determined in qemu, so still can't guarantee that no more mess up for ID and name. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block

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

2013-06-25 Thread Wenchao Xia
. grammar fix. 6/9: redesiged interface: take both id and name as optional parameter, return the deleted snapshot's info. Address Stefan's comments: 4/9: add '' around %s in message. drop code comments about vm_clock. 9/9: better doc, refined the code and add more test case. Wenchao Xia (9): 1

[Qemu-devel] [PATCH V3 3/9] snapshot: distinguish id and name in snapshot delete

2013-06-25 Thread Wenchao Xia
. For sheepdog, it does nothing. After this patch: For qcow2, logic is the same by call it twice in caller. For rbd, it always fails in delete with id, but still search for name in second try, no change for user. Some code for *errp is based on Pavel's patch. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V3 4/9] qmp: add internal snapshot support in qmp_transaction

2013-06-25 Thread Wenchao Xia
in this interface. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c | 117 ++ qapi-schema.json | 18 - qmp-commands.hx | 33 --- 3 files changed, 160 insertions(+), 8 deletions(-) diff --git

[Qemu-devel] [PATCH V3 7/9] hmp: add interface hmp_snapshot_blkdev_internal

2013-06-25 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 915b0d1..53e3ef3 100644

[Qemu-devel] [PATCH V3 1/9] snapshot: new function bdrv_snapshot_find_by_id_and_name()

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

[Qemu-devel] [PATCH V3 5/9] qmp: add interface blockdev-snapshot-internal-sync

2013-06-25 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 | 22 ++ qmp-commands.hx | 30 ++ 3 files changed, 65 insertions(+), 0

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

2013-06-25 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/056 | 267 tests/qemu-iotests/056.out |5 + tests/qemu-iotests/group |1 + 3 files changed

[Qemu-devel] [PATCH V3 6/9] qmp: add interface blockdev-snapshot-delete-internal-sync

2013-06-25 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 ++ qapi-schema.json | 27 +++ qmp-commands.hx | 41

[Qemu-devel] [PATCH V3 8/9] hmp: add interface hmp_snapshot_delete_blkdev_internal

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

Re: [Qemu-devel] [PATCH V2 5/7] monitor: support sub commands in auto completion

2013-06-25 Thread Wenchao Xia
于 2013-6-24 20:48, Wenchao Xia 写道: This patch allow auot completion work normal in sub command case, info block [DEVICE] can auto complete now, by re-enter the completion function. Also, original info is treated as a special case, now it is treated as a sub command group, global variable

[Qemu-devel] [PATCH V2 2/7] monitor: discard global variable *mon_cmds

2013-06-24 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 V2 5/7] monitor: support sub commands in auto completion

2013-06-24 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 --- monitor.c | 36 1 files changed, 24 insertions(+), 12 deletions

[Qemu-devel] [PATCH V2 1/7] monitor: discard global variable *cur_mon in completion functions

2013-06-24 Thread Wenchao Xia
Parameter *mon is added to replace *cur_mon, and readline_completion() pass rs-mon as value, which should be initialized in readline_init() called by monitor_init(). In short, structure ReadLineState controls where the action would be taken now. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V2 0/7] monitor: support sub command group in auto completion and help

2013-06-24 Thread Wenchao Xia
in monitor_find_completion(). Wenchao Xia (7): 1 monitor: discard global variable *cur_mon in completion functions 2 monitor: discard global variable *mon_cmds 3 monitor: discard global variable *info_cmds in help functions 4 monitor: code move for parse_cmdline() 5 monitor: support sub commands in auto

[Qemu-devel] [PATCH V2 4/7] monitor: code move for parse_cmdline()

2013-06-24 Thread Wenchao Xia
Also fix code style error reported by check script. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c | 186 +++-- 1 files changed, 94 insertions(+), 92 deletions(-) diff --git a/monitor.c b/monitor.c index 54fc36f

[Qemu-devel] [PATCH V2 6/7] monitor: improve help in auto completion for sub command

2013-06-24 Thread Wenchao Xia
Now special case help * in auto completion can work with sub commands, such as help info a*. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index f364a0d..8b26b48 100644

[Qemu-devel] [PATCH V2 3/7] monitor: discard global variable *info_cmds in help functions

2013-06-24 Thread Wenchao Xia
as special help case. compare_cmd() is used instead of strcmp() in command searching. To tip better what the patch does, code moving is avoided by declare parse_cmdline() ahead. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c | 67

[Qemu-devel] [PATCH V2 7/7] monitor: improve help to allow show tip of single command in sub group

2013-06-24 Thread Wenchao Xia
A new parameter type 'S' is introduced to allow user input any string. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp-commands.hx |2 +- monitor.c | 30 +- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/hmp-commands.hx b/hmp

Re: [Qemu-devel] [PATCH V2] build: remove compile warning

2013-06-24 Thread Wenchao Xia
smart compilers will not detect a human's mistakes anymore. Paolo Hi Palo, There is V3 remove uninitlized warning without adding = 0, could u take a look for it? http://lists.nongnu.org/archive/html/qemu-devel/2013-06/msg02348.html -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 1/2] monitor: discard global variable in auto completion functions

2013-06-23 Thread Wenchao Xia
于 2013-6-21 23:24, Luiz Capitulino 写道: On Fri, 21 Jun 2013 14:37:37 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: In monitor_find_completion() and related functions, Global variable *mon_cmds is not used any more, make them reenterable safely. *cur_mon is also not used now. *info_cmds

[Qemu-devel] [PATCH 0/2] support sub command group for auto completion in monitor

2013-06-21 Thread Wenchao Xia
in it, a monitor can be created with different command tables, but that requirement do not exist yet, so not changed it to save trouble. Wenchao Xia (2): 1) monitor: discard global variable in auto completion functions 2) monitor: support sub commands in auto completion include/monitor/readline.h

[Qemu-devel] [PATCH 2/2] monitor: support sub commands in auto completion

2013-06-21 Thread Wenchao Xia
-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/monitor.c b/monitor.c index bc60171..c706644 100644 --- a/monitor.c +++ b/monitor.c @@ -4180,6 +4180,11 @@ static void monitor_find_completion(Monitor *mon

Re: [Qemu-devel] QEMU Memory subsystem

2013-06-21 Thread Wenchao Xia
I think you can archieve your goal relative easily in soft-mmu mode, but in KVM case, you will need to dig a bit in kvm.ko in kernel source code. -- Best Regards Wenchao Xia

[Qemu-devel] [PATCH 1/2] monitor: discard global variable in auto completion functions

2013-06-21 Thread Wenchao Xia
In monitor_find_completion() and related functions, Global variable *mon_cmds is not used any more, make them reenterable safely. *cur_mon is also not used now. *info_cmds is still there, but soon will be removed by a new way of sub command completion. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [RFC] qemu-img: add option -d in convert

2013-06-20 Thread Wenchao Xia
is to provide user snapshot_read() and snapshot_allocated() interface, typically a library. But that need some adjust in block level, especially thread, coroutine, and emulator cut off, so delay that. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync

2013-06-19 Thread Wenchao Xia
于 2013-6-18 22:20, Stefan Hajnoczi 写道: On Mon, Jun 17, 2013 at 11:25:26AM +0800, Wenchao Xia wrote: 于 2013-6-15 17:55, Eric Blake 写道: Should this command be made available via 'transaction'? That is, if I have a two-disk VM, and use 'transaction' to take a snapshot of both disks at once

Re: [Qemu-devel] [PATCH V2 12/12] qemu-iotests: add 055 internal snapshot for block device test case

2013-06-19 Thread Wenchao Xia
于 2013-6-18 22:32, Stefan Hajnoczi 写道: On Fri, Jun 14, 2013 at 07:39:59PM +0800, Wenchao Xia wrote: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/055 | 157 tests/qemu-iotests/055.out |5 ++ drive-backup

Re: [Qemu-devel] [PATCH V2] build: remove compile warning

2013-06-19 Thread Wenchao Xia
-Werror to break build. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync

2013-06-19 Thread Wenchao Xia
于 2013-6-19 15:46, Stefan Hajnoczi 写道: On Wed, Jun 19, 2013 at 02:18:48PM +0800, Wenchao Xia wrote: 于 2013-6-18 22:20, Stefan Hajnoczi 写道: On Mon, Jun 17, 2013 at 11:25:26AM +0800, Wenchao Xia wrote: 于 2013-6-15 17:55, Eric Blake 写道: Should this command be made available via 'transaction

Re: [Qemu-devel] [PATCH V2 12/12] qemu-iotests: add 055 internal snapshot for block device test case

2013-06-19 Thread Wenchao Xia
On Wed, Jun 19, 2013 at 02:21:31PM +0800, Wenchao Xia wrote: 于 2013-6-18 22:32, Stefan Hajnoczi 写道: On Fri, Jun 14, 2013 at 07:39:59PM +0800, Wenchao Xia wrote: +def createSnapshotInTransaction(self, snapshot_num): +actions = [] +for i in range(0, len(self.expect

Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync

2013-06-19 Thread Wenchao Xia
于 2013-6-19 22:24, Stefan Hajnoczi 写道: On Wed, Jun 19, 2013 at 04:53:38PM +0800, Wenchao Xia wrote: 于 2013-6-19 15:46, Stefan Hajnoczi 写道: On Wed, Jun 19, 2013 at 02:18:48PM +0800, Wenchao Xia wrote: 于 2013-6-18 22:20, Stefan Hajnoczi 写道: On Mon, Jun 17, 2013 at 11:25:26AM +0800, Wenchao Xia

Re: [Qemu-devel] [PATCH 6/9] vhost-scsi: new device supporting the tcm_vhost Linux kernel module

2013-06-19 Thread Wenchao Xia
. Regards, baiqing -Original Message- From: qemu-devel-bounces+libaiqing=huawei@nongnu.org [mailto:qemu-devel-bounces+libaiqing=huawei@nongnu.org] On Behalf Of Paolo Bonzini Sent: Tuesday, May 28, 2013 4:01 PM To: Wenchao Xia Cc: as...@redhat.com; qemu-devel@nongnu.org; n...@linux

Re: [Qemu-devel] [PATCH v6] net: add support of mac-programming over macvtap in QEMU side

2013-06-17 Thread Wenchao Xia
right? could u add some document in commit message, so reader can understand what it trying to do? -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 0/5] qcow2: Discard freed clusters

2013-06-17 Thread Wenchao Xia
++-- tests/qemu-iotests/group | 2 +- 8 files changed, 214 insertions(+), 153 deletions(-) -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V2 07/12] qmp: add internal snapshot support in qmp_transaction

2013-06-16 Thread Wenchao Xia
Will fix the grammar, thanks for checking. On 06/14/2013 12:39 PM, Wenchao Xia wrote: Unlike savevm, the qmp_transaction interface will not generate snapshot name automatically, saving trouble to return information of the new created snapshot. The snapshot name should not mess up

Re: [Qemu-devel] [PATCH V2 08/12] qmp: add interface blockdev-snapshot-internal-sync

2013-06-16 Thread Wenchao Xia
于 2013-6-15 17:51, Eric Blake 写道: On 06/14/2013 12:39 PM, Wenchao Xia wrote: This interface can generate snapshot name automatically if it is not specified, since it is a single opertion. s/opertion/operation/ Snapshot ID can't be specified in this interface. Signed-off-by: Wenchao Xia

Re: [Qemu-devel] [PATCH V2 09/12] qmp: add interface blockdev-snapshot-delete-internal-sync

2013-06-16 Thread Wenchao Xia
于 2013-6-15 17:55, Eric Blake 写道: On 06/14/2013 12:39 PM, Wenchao Xia wrote: Snapshot ID can't be specified in this interface. Why not? If it is possible to look up by id in isolation, then it should be possible to delete by id in isolation. Also, if it is possible to create a snapshot

[Qemu-devel] [PATCH V2 00/12] add internal snapshot support at block device level

2013-06-14 Thread Wenchao Xia
document and spell fix. 10/12, 11/12: rename the command and related function to snapshot_blkdev_internal. Stefan Hajnoczi (3): 1 blockdev: drop redundant proto_drv check 2 blockdev: rename BlkTransactionStates to singular 3 blockdev: allow BdrvActionOps-commit() to be NULL Wenchao Xia (9): 4

[Qemu-devel] [PATCH V2 01/12] blockdev: drop redundant proto_drv check

2013-06-14 Thread Wenchao Xia
-by: Eric Blake ebl...@redhat.com Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c | 15 --- 1 files changed, 0 insertions(+), 15 deletions(-) diff --git a/blockdev.c b/blockdev.c index 9937311..e70225b 100644

[Qemu-devel] [PATCH V2 08/12] qmp: add interface blockdev-snapshot-internal-sync

2013-06-14 Thread Wenchao Xia
This interface can generate snapshot name automatically if it is not specified, since it is a single opertion. Snapshot ID can't be specified in this interface. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c | 25 + qapi-schema.json | 23

[Qemu-devel] [PATCH V2 03/12] blockdev: allow BdrvActionOps-commit() to be NULL

2013-06-14 Thread Wenchao Xia
will probably follow the same pattern, so allow .commit() to be NULL. Suggested-by: Eric Blake ebl...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH V2 12/12] qemu-iotests: add 055 internal snapshot for block device test case

2013-06-14 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/055 | 157 tests/qemu-iotests/055.out |5 ++ tests/qemu-iotests/group |1 + 3 files changed, 163 insertions(+), 0 deletions(-) create mode 100755 tests/qemu

[Qemu-devel] [PATCH V2 05/12] snapshot: add paired functions for internal snapshot id and name

2013-06-14 Thread Wenchao Xia
be also taken in qcow2_snapshot_create(), but require it to return error reason. For rbd, it have no ID, so have no impact. For sheepdog, ID can't be determined in qemu, so still can't guarantee that no more mess up for ID and name. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block

[Qemu-devel] [PATCH V2 06/12] snapshot: distinguish id and name in snapshot delete

2013-06-14 Thread Wenchao Xia
. For sheepdog, it does nothing. After this patch: For qcow2, logic is the same by call it twice in caller. For rbd, it always fails in delete with id, but still search for name in second try, no change for user. Some code for *errp is based on Pavel's patch. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V2 07/12] qmp: add internal snapshot support in qmp_transaction

2013-06-14 Thread Wenchao Xia
in this interface. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c | 118 ++ qapi-schema.json | 16 +++ qmp-commands.hx | 32 +++--- 3 files changed, 159 insertions(+), 7 deletions(-) diff --git

[Qemu-devel] [PATCH V2 11/12] hmp: add interface hmp_snapshot_delete_blkdev_internal

2013-06-14 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, 30 insertions(+), 0 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 312a0c7..5a66515 100644

[Qemu-devel] [PATCH V3] build: remove compile warning

2013-06-14 Thread Wenchao Xia
This patch simply remove variable may be used uninitialized warning. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- V2: Address Stefan and Peter's comments, use 0 in send_msg() instead of initialize mhHeader. V3: Address Markus's comments, adjust the code section in iov.c. libcacard

<    4   5   6   7   8   9   10   11   12   13   >