Re: [Qemu-devel] [patch] introduce MIG_STATE_CANCELLING state

2013-12-05 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH V7 5/6] qemu-iotests: add test for snapshot in qemu-img convert

2013-12-04 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/058 | 19 ++- tests/qemu-iotests/058.out | 12 2 files changed, 30 insertions(+), 1 deletions(-) diff --git a/tests/qemu-iotests/058 b/tests/qemu-iotests/058 index cf50857..14584cd

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

2013-12-04 Thread Wenchao Xia
to let caller know the errno, and errno will be used later. Also fix a typo in comments of bdrv_snapshot_delete(). Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qcow2-snapshot.c| 10 ++- block/qcow2.h |5 +++- block/snapshot.c | 59

[Qemu-devel] [PATCH V7 4/6] qemu-img: add -l for snapshot in convert

2013-12-04 Thread Wenchao Xia
Now qemu-img convert have similar options as qemu-nbd for internal snapshot. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qemu-img-cmds.hx |4 ++-- qemu-img.c | 44 +++- qemu-img.texi| 12 3 files changed, 45

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

2013-12-04 Thread Wenchao Xia
1/method 2 in echo message, to tip better. Wenchao Xia (6): 1 snapshot: distinguish id and name in load_tmp 2 qemu-nbd: support internal snapshot export 3 qemu-iotests: add 058 internal snapshot export with qemu-nbd case 4 qemu-img: add -l for snapshot in convert 5 qemu-iotests: add test

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

2013-12-04 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 xiaw...@linux.vnet.ibm.com --- block/snapshot.c | 18 ++ include/block/snapshot.h |8 qemu

[Qemu-devel] [PATCH V7 6/6] qemu-nbd: add doc for option -f

2013-12-04 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qemu-nbd.c|1 + qemu-nbd.texi |2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index fe6053c..136e8c9 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -79,6 +79,7 @@ static void usage

Re: [Qemu-devel] [PATCH V7 4/6] qemu-img: add -l for snapshot in convert

2013-12-04 Thread Wenchao Xia
于 2013/12/5 4:42, Eric Blake 写道: On 12/04/2013 02:10 AM, Wenchao Xia wrote: Now qemu-img convert have similar options as qemu-nbd for internal snapshot. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- @@ -1183,6 +1189,18 @@ static int img_convert(int argc, char **argv

Re: [Qemu-devel] [PATCH v3] block: Close backing file early in bdrv_img_create

2013-12-03 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH V6 4/6] qemu-img: add -l for snapshot in convert

2013-12-03 Thread Wenchao Xia
于 2013/12/3 19:02, Stefan Hajnoczi 写道: On Fri, Nov 22, 2013 at 12:27:10PM +0800, Wenchao Xia wrote: diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index da1d965..9a8153b 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -34,7 +34,7 @@ STEXI ETEXI DEF(convert, img_convert

Re: [Qemu-devel] [PATCH V6 3/6] qemu-iotests: add 058 internal snapshot export with qemu-nbd case

2013-12-03 Thread Wenchao Xia
于 2013/12/3 21:45, Stefan Hajnoczi 写道: On Fri, Nov 22, 2013 at 12:27:09PM +0800, Wenchao Xia wrote: +nbd_snapshot_port=10850 +nbd_snapshot_img=nbd:127.0.0.1:$nbd_snapshot_port + +_export_nbd_snapshot() +{ +$QEMU_NBD -v -t -b 127.0.0.1 -p $nbd_snapshot_port $TEST_IMG -l $1 Please use

Re: [Qemu-devel] [PATCH V2 5/8] qapi script: use same function to generate enum string

2013-12-02 Thread Wenchao Xia
于 2013/12/3 4:17, Eric Blake 写道: On 11/12/2013 03:25 PM, Wenchao Xia wrote: One function one rule, so the enum string generating have same behavior for different caller. If multiple caller exist for one enum define in schema, it is for sure the generated string is identical. Note before

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

2013-12-02 Thread Wenchao Xia
于 2013/11/29 16:54, Wenchao Xia 写道: v6: Address Kevin's comments: 1: typo fix, remove device and snapshot info in error message. 2: use strstart(). 3: use _require_command(), limit proto to file, since when proto=nbd it can't work. also changed _require_command() to tip

Re: [Qemu-devel] [PATCH v4 2/6] qemu-iotests: Honour cache mode in iotests.py

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

Re: [Qemu-devel] [PATCH v4 3/6] qemu-iotests: Add _default_cache_mode and _supported_cache_modes

2013-12-02 Thread Wenchao Xia
This patch override only when default is specified, I am +1 with it. I think we had discuss before, just want a double check, stefan, do you agree with this? This replaces _unsupported_qemu_io_options and check for support of current cache mode, and allow to provide a default if user didn't

Re: [Qemu-devel] [PATCH v4 4/6] qemu-iotests: Change default cache mode to writeback

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

Re: [Qemu-devel] [PATCH v4 5/6] qemu-iotests: Clean up spaces in usage output

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

Re: [Qemu-devel] [PATCH v4 1/6] qemu-iotests: Add -c cache-mode option

2013-12-02 Thread Wenchao Xia
xpand=true @@ -147,6 +155,7 @@ check options -o options -o options to pass to qemu-img create/convert -Toutput timestamps -r randomize test order +-c cache mode +-c mode

Re: [Qemu-devel] [PATCH V6 6/6] qemu-iotests: add test for qcow2 snapshot

2013-12-01 Thread Wenchao Xia
于 2013/11/30 4:56, Max Reitz 写道: On 11.11.2013 00:56, Wenchao Xia wrote: This test will focus on the low level procedure of qcow2 snapshot operations, now it covers only the create operation. Overlap error paths are not checked since no good way to trigger those errors. Signed-off-by: Wenchao

Re: [Qemu-devel] [PATCH v2] block: Close backing file early in bdrv_img_create

2013-12-01 Thread Wenchao Xia
于 2013/11/30 4:41, Max Reitz 写道: Leaving the backing file open although it is not needed anymore can cause problems if it is opened through a block driver which allows exclusive access only and if the create function of the block driver used for the top image (the one being created) tries to

Re: [Qemu-devel] [PATCH] block: Use BDRV_O_NO_BACKING where appropriate

2013-12-01 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH RFC 2/3] qapi script: add support of event

2013-12-01 Thread Wenchao Xia
+ +if (!qapi_event_functions.emit) { Better to return an error here instead of silently failing. The purpose is allowing emit=NULL and skip event code in that case. But the code will do nothing and the caller won't know that. Now the caller also won't know that useless code

[Qemu-devel] [PATCH V3 6/9] qapi script: support pre-defined enum type as discriminator in union

2013-11-29 Thread Wenchao Xia
code, if discriminator is an enum field. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- docs/qapi-code-gen.txt |8 ++-- scripts/qapi-types.py | 18 ++ scripts/qapi-visit.py | 23 --- scripts/qapi.py|4 +++- 4 files changed, 39

[Qemu-devel] [PATCH Resend V3 0/9] qapi script: support enum as discriminator and better enum name

2013-11-29 Thread Wenchao Xia
at compile time. 8/8: correspond test case change. v3: General: move enum name generation patch to last in the series, add convert patch 8/9. Address Luiz and Kevin's comments: Better introduction. 6/9: renamed this patch, add docs/qapi-code-gen.txt part. Wenchao Xia (9): 1 qapi script

[Qemu-devel] [PATCH V3 4/9] qapi script: code move for generate_enum_name()

2013-11-29 Thread Wenchao Xia
Later both qapi-types.py and qapi-visit.py need a common function for enum name generation. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- scripts/qapi-types.py | 10 -- scripts/qapi.py | 10 ++ 2 files changed, 10

[Qemu-devel] [PATCH V3 3/9] qapi script: check correctness of discriminator values in union

2013-11-29 Thread Wenchao Xia
It will check whether the values specified are written correctly, and whether all enum values are covered, when discriminator is a pre-defined enum type Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi-visit.py | 17 + scripts/qapi.py | 31

[Qemu-devel] [PATCH V3 1/9] qapi script: remember enum values

2013-11-29 Thread Wenchao Xia
Later other scripts will need to check the enum values. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- scripts/qapi.py| 18 ++ tests/qapi-schema/comments.out |2 +- tests/qapi-schema/qapi

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

2013-11-29 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 xiaw...@linux.vnet.ibm.com --- include/qapi/qmp/qerror.h |2 +- scripts/qapi.py | 26 +++--- target-i386/cpu.c

[Qemu-devel] [PATCH V3 2/9] qapi script: add check for duplicated key

2013-11-29 Thread Wenchao Xia
It is bad that same key was specified twice, especially when a union have two branches with same condition. This patch can prevent it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi.py |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/scripts

[Qemu-devel] [PATCH V3 7/9] tests: add cases for inherited struct and union with discriminator

2013-11-29 Thread Wenchao Xia
Test for inherit and complex union. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qapi-schema/qapi-schema-test.json | 27 ++ tests/qapi-schema/qapi-schema-test.out | 11 +++ tests/test-qmp-input-visitor.c | 120 + tests/test-qmp-output

[Qemu-devel] [PATCH V3 8/9] qapi: convert BlockdevOptions to use enum discriminator

2013-11-29 Thread Wenchao Xia
After this patch, hidden enum type BlockdevOptionsKind will not be generated, and other API can use enum BlockdevDriver. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qapi-schema.json | 14 +- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/qapi

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

2013-11-29 Thread Wenchao Xia
v6: Address Kevin's comments: 1: typo fix, remove device and snapshot info in error message. 2: use strstart(). 3: use _require_command(), limit proto to file, since when proto=nbd it can't work. also changed _require_command() to tip better. 4: use strstart(). 6: new

Re: [Qemu-devel] [PATCH V2 0/8] qapi script: support enum as discriminator and better enum name

2013-11-28 Thread Wenchao Xia
于 2013/11/28 22:24, Luiz Capitulino 写道: On Thu, 28 Nov 2013 14:19:48 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013/11/26 0:47, Luiz Capitulino 写道: On Wed, 13 Nov 2013 06:25:00 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: This series is respined from RFC series at: http

Re: [Qemu-devel] [PATCH V6 0/6] qcow2: rollback the modification on fail in snapshot creation

2013-11-27 Thread Wenchao Xia
Hi, Any comments for it? respin?

Re: [Qemu-devel] [PATCH V2 0/8] qapi script: support enum as discriminator and better enum name

2013-11-27 Thread Wenchao Xia
于 2013/11/26 0:47, Luiz Capitulino 写道: On Wed, 13 Nov 2013 06:25:00 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: This series is respined from RFC series at: http://lists.nongnu.org/archive/html/qemu-devel/2013-11/msg00363.html Patch 1-6 add support for enum as discriminator. Patch 7

Re: [Qemu-devel] [PATCH RFC 2/3] qapi script: add support of event

2013-11-27 Thread Wenchao Xia
于 2013/11/28 8:48, Luiz Capitulino 写道: On Wed, 13 Nov 2013 09:44:52 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: Nested structure is not supported now, so following define is not valid: { 'event': 'EVENT_C', 'data': { 'a': { 'a_a', 'str', 'a_b', 'str' }, 'b': 'int' } I think your

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

2013-11-22 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 xiaw...@linux.vnet.ibm.com --- block/snapshot.c | 18 ++ include/block/snapshot.h |8 qemu

[Qemu-devel] [PATCH V6 3/6] qemu-iotests: add 058 internal snapshot export with qemu-nbd case

2013-11-22 Thread Wenchao Xia
a blank. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/058 | 103 ++ tests/qemu-iotests/058.out | 32 + tests/qemu-iotests/check |1 + tests/qemu-iotests/common.rc |3 +- tests/qemu-iotests

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

2013-11-22 Thread Wenchao Xia
to let caller know the errno, and errno will be used later. Also fix a typo in comments of bdrv_snapshot_delete(). Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qcow2-snapshot.c| 10 ++- block/qcow2.h |5 +++- block/snapshot.c | 59

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

2013-11-22 Thread Wenchao Xia
work. also changed _require_command() to tip better. 4: use strstart(). 6: new patch, since I found the doc missing in debugging. Wenchao Xia (6): 1 snapshot: distinguish id and name in load_tmp 2 qemu-nbd: support internal snapshot export 3 qemu-iotests: add 058 internal snapshot export

[Qemu-devel] [PATCH V6 6/6] qemu-nbd: add doc for option -f

2013-11-22 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qemu-nbd.c|1 + qemu-nbd.texi |2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index fe6053c..136e8c9 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -79,6 +79,7 @@ static void usage

[Qemu-devel] [PATCH V6 5/6] qemu-iotests: add test for snapshot in qemu-img convert

2013-11-22 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/058 | 19 ++- tests/qemu-iotests/058.out | 12 2 files changed, 30 insertions(+), 1 deletions(-) diff --git a/tests/qemu-iotests/058 b/tests/qemu-iotests/058 index 0b48386..19d8a8c

[Qemu-devel] [PATCH V6 4/6] qemu-img: add -l for snapshot in convert

2013-11-22 Thread Wenchao Xia
Now qemu-img convert have similar options as qemu-nbd for internal snapshot. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qemu-img-cmds.hx |2 +- qemu-img.c | 44 +++- qemu-img.texi| 12 3 files changed, 44

Re: [Qemu-devel] Is there any new progress or plans about ram live snapshot feature?

2013-11-21 Thread Wenchao Xia
于 2013/11/21 19:02, Zhanghailiang 写道: Hi, Now qemu ram live snapshot feature has some problems, it is based on ‘ram live migration’. The time of snapshot depends on completion time of migration, which is not measurable. Also It may can’t achieve migrate in some situation. I have seen

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

2013-11-21 Thread Wenchao Xia
于 2013/11/19 19:20, Kevin Wolf 写道: Am 10.11.2013 um 23:03 hat Wenchao Xia geschrieben: 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 introduce function bdrv_snapshot_load_tmp_by_id_or_name() that call

Re: [Qemu-devel] [PATCH V5 2/5] qemu-nbd: support internal snapshot export

2013-11-21 Thread Wenchao Xia
于 2013/11/19 19:26, Kevin Wolf 写道: Am 10.11.2013 um 23:03 hat Wenchao Xia geschrieben: 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 xiaw...@linux.vnet.ibm.com --- block

Re: [Qemu-devel] [PATCH RFC 0/3] add direct support of event in qapi schema

2013-11-21 Thread Wenchao Xia
于 2013/11/13 9:44, Wenchao Xia 写道: This series add support for tag/keyword 'event' in qapi-schema. The implemention doesn't generate a struture and visit function in the background for every event, so it doesn't support nested structure in the define to avoid trouble. It is on top of series

Re: [Qemu-devel] [PATCH V5 3/5] qemu-iotests: add 058 internal snapshot export with qemu-nbd case

2013-11-21 Thread Wenchao Xia
于 2013/11/19 19:29, Kevin Wolf 写道: Am 10.11.2013 um 23:03 hat Wenchao Xia geschrieben: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/058 | 102 tests/qemu-iotests/058.out | 32 ++ tests/qemu

[Qemu-devel] [PATCH RFC 3/3] tests: add test cases for qapi event support

2013-11-13 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/Makefile | 14 ++- tests/qapi-schema/qapi-schema-test.json | 12 ++ tests/qapi-schema/qapi-schema-test.out | 10 +- tests/test-qmp-event.c | 250 +++ 4

[Qemu-devel] [PATCH RFC 1/3] os-posix: include sys/time.h

2013-11-13 Thread Wenchao Xia
Since gettimeofday() is used in this header file as a macro define, include the function's define header file, to avoid compile warning when other file include os-posix.h. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- include/sysemu/os-posix.h |2 ++ 1 files changed, 2 insertions

[Qemu-devel] [PATCH RFC 2/3] qapi script: add support of event

2013-11-13 Thread Wenchao Xia
Nested structure is not supported now, so following define is not valid: { 'event': 'EVENT_C', 'data': { 'a': { 'a_a', 'str', 'a_b', 'str' }, 'b': 'int' } Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- Makefile |9 +- Makefile.objs |2 +- qapi

[Qemu-devel] [PATCH 2/2] try

2013-11-13 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- Makefile|9 +- Makefile.objs |2 +- include/qapi/qmp-event.h| 29 +++ qapi/Makefile.objs |1 + qapi/qmp-event.c

[Qemu-devel] [PATCH RFC 0/3] add direct support of event in qapi schema

2013-11-13 Thread Wenchao Xia
/qemu-devel/2013-11/msg01574.html Wenchao Xia (3): 1 os-posix: include sys/time.h 2 qapi script: add support of event 3 tests: add test cases for qapi event support Makefile|9 +- Makefile.objs |2 +- include/sysemu/os-posix.h

Re: [Qemu-devel] [PATCH 2/2] try

2013-11-13 Thread Wenchao Xia
Sorry I sent this draft patch by mistake, please ignore this one and have a look at the rest 3 patches.

Re: [Qemu-devel] [PATCH v3 2/2] qapi: Change BlockDirtyInfo to list

2013-11-13 Thread Wenchao Xia
--- a/qapi-schema.json +++ b/qapi-schema.json @@ -948,8 +948,8 @@ # @tray_open: #optional True if the device has a tray and it is open # (only present if removable is true) # -# @dirty: #optional dirty bitmap information (only present if the dirty -# bitmap is enabled)

Re: [Qemu-devel] [PATCH v3 2/2] qapi: Change BlockDirtyInfo to list

2013-11-13 Thread Wenchao Xia
于 2013/11/13 22:40, Fam Zheng 写道: On Wed, Nov 13, 2013 at 10:19 PM, Kevin Wolf kw...@redhat.com wrote: Am 13.11.2013 um 11:29 hat Fam Zheng geschrieben: We have multiple dirty bitmaps in BDS now, switch QAPI to allow query it (BlockInfo.dirty_bitmaps), and also drop old BlockInfo.dirty.

Re: [Qemu-devel] [PATCH V6 0/6] qcow2: rollback the modification on fail in snapshot creation

2013-11-13 Thread Wenchao Xia
ping?

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

2013-11-13 Thread Wenchao Xia
Hello, any more comments?

Re: [Qemu-devel] [PATCH V2 0/8] qapi script: support enum as discriminator and better enum name

2013-11-13 Thread Wenchao Xia
Just found timestamp of this series seems older than v1, so ping to correct it.

Re: [Qemu-devel] [PATCH] block/stream: Don't stream unbacked devices

2013-11-13 Thread Wenchao Xia
= 0; void *buf; +if (!bs-backing_hd) { +block_job_completed(s-common, 0); +return; +} + s-common.len = bdrv_getlength(bs); if (s-common.len 0) { block_job_completed(s-common, s-common.len); Reviewed-by: Wenchao Xia xiaw

Re: [Qemu-devel] [PATCH] qemu-iotests: Add -c cache-mode to check

2013-11-13 Thread Wenchao Xia
Tried on RH6.4 x86_64 on upstream, the value can be passed to the final vm boot command. Tested-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH 3/8] qapi script: check correctness of discriminator values in union

2013-11-12 Thread Wenchao Xia
于 2013/11/13 2:12, Eric Blake 写道: On 11/06/2013 12:33 PM, Wenchao Xia wrote: It will check whether the values specified are written correctly when discriminator is a pre-defined enum type, which help check whether the schema is in good form. It is allowed, that not every value in enum is used

[Qemu-devel] [PATCH V2 0/8] qapi script: support enum as discriminator and better enum name

2013-11-12 Thread Wenchao Xia
check for enum value at compile time. 8: correspond test case change. Wenchao Xia (8): 1 qapi script: remember enum values 2 qapi script: add check for duplicated key 3 qapi script: check correctness of discriminator values in union 4 qapi script: code move for generate_enum_name() 5

[Qemu-devel] [PATCH V2 5/8] qapi script: use same function to generate enum string

2013-11-12 Thread Wenchao Xia
, although the patch changes it, the final string generated is not changed. The custom function used before will met problem when capitalized discriminator value is introduced. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi-types.py |6 +++--- scripts/qapi-visit.py | 21

[Qemu-devel] [PATCH V2 2/8] qapi script: add check for duplicated key

2013-11-12 Thread Wenchao Xia
It is bad that same key was specified twice, especially when a union have two branches with same condition. This patch can prevent it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi.py |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/scripts

[Qemu-devel] [PATCH V2 3/8] qapi script: check correctness of discriminator values in union

2013-11-12 Thread Wenchao Xia
It will check whether the values specified are written correctly, and whether all enum values are covered, when discriminator is a pre-defined enum type Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi-visit.py | 17 + scripts/qapi.py | 31

[Qemu-devel] [PATCH V2 7/8] qapi script: do not add _ for every capitalized char in enum

2013-11-12 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 xiaw...@linux.vnet.ibm.com --- include/qapi/qmp/qerror.h |2 +- scripts/qapi.py | 26 +++--- target-i386/cpu.c

[Qemu-devel] [PATCH V2 1/8] qapi script: remember enum values

2013-11-12 Thread Wenchao Xia
Later other scripts will need to check the enum values. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- scripts/qapi.py| 18 ++ tests/qapi-schema/comments.out |2 +- tests/qapi-schema/qapi

[Qemu-devel] [PATCH V2 8/8] tests: add cases for inherited struct and union with discriminator

2013-11-12 Thread Wenchao Xia
Test for inherit and complex union. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qapi-schema/qapi-schema-test.json | 27 ++ tests/qapi-schema/qapi-schema-test.out | 11 +++ tests/test-qmp-input-visitor.c | 120 + tests/test-qmp-output

[Qemu-devel] [PATCH V2 6/8] qapi script: not generate hidden enum type for pre-defined enum discriminator

2013-11-12 Thread Wenchao Xia
code. In short, enum type as discriminator is fully supported now. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi-types.py | 18 ++ scripts/qapi-visit.py | 23 --- scripts/qapi.py |4 +++- 3 files changed, 33 insertions

[Qemu-devel] [PATCH V2 4/8] qapi script: code move for generate_enum_name()

2013-11-12 Thread Wenchao Xia
Later both qapi-types.py and qapi-visit.py need a common function for enum name generation. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- scripts/qapi-types.py | 10 -- scripts/qapi.py | 10 ++ 2 files changed, 10

[Qemu-devel] [PATCH V6 5/6] blkdebug: add debug events for snapshot

2013-11-11 Thread Wenchao Xia
Some code in qcow2-snapshot.c directly accesses bs-file, so in those places errors can't be injected by other events. Since the code in qcow2-snapshot.c is similar to the other qcow2 internal code (in regards to e.g. the L1 table), add some debug events. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V6 4/6] qcow2: cancel the modification on fail in qcow2_snapshot_create()

2013-11-11 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Max Reitz mre...@redhat.com --- block/qcow2-snapshot.c | 25 + 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 70e329e..685ef8b 100644

[Qemu-devel] [PATCH V6 0/6] qcow2: rollback the modification on fail in snapshot creation

2013-11-11 Thread Wenchao Xia
typo fix in comments. 5 typo fix in commit message. Address Eric's comments: 2 fix 32bit/64bit issue in printf for sizeof and offse. v6: Address Jeff's comments: 6: add quote for image name in test case. Wenchao Xia (6): 1 snapshot: add parameter *errp in snapshot create 2 qcow2: add

Re: [Qemu-devel] [PATCH V5 6/6] qemu-iotests: add test for qcow2 snapshot

2013-11-10 Thread Wenchao Xia
于 2013/11/9 4:50, Jeff Cody 写道: On Tue, Nov 05, 2013 at 08:01:29AM +0800, Wenchao Xia wrote: This test will focus on the low level procedure of qcow2 snapshot operations, now it covers only the create operation. Overlap error paths are not checked since no good way to trigger those errors

Re: [Qemu-devel] [PATCH V4 5/5] qemu-iotests: add test for snapshot in qemu-img convert

2013-11-10 Thread Wenchao Xia
于 2013/11/9 1:18, Jeff Cody 写道: On Fri, Oct 11, 2013 at 10:33:31AM +0800, Wenchao Xia wrote: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/058 | 19 ++- tests/qemu-iotests/058.out | 12 2 files changed, 30 insertions(+), 1

[Qemu-devel] [PATCH V5 3/5] qemu-iotests: add 058 internal snapshot export with qemu-nbd case

2013-11-10 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/058 | 102 tests/qemu-iotests/058.out | 32 ++ tests/qemu-iotests/check |1 + tests/qemu-iotests/group |1 + 4 files changed, 136 insertions

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

2013-11-10 Thread Wenchao Xia
as deprecated, added doc for them. v5: Address Jeff's comments: Quote image name in test cases. Wenchao Xia (5): 1 snapshot: distinguish id and name in load_tmp 2 qemu-nbd: support internal snapshot export 3 qemu-iotests: add 058 internal snapshot export with qemu-nbd case 4 qemu-img: add

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

2013-11-10 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 xiaw...@linux.vnet.ibm.com --- block/snapshot.c | 18 + include/block/snapshot.h |8 +++ qemu

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

2013-11-10 Thread Wenchao Xia
to let caller know the errno, and errno will be used later. Also fix a typo in comments of bdrv_snapshot_delete(). Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qcow2-snapshot.c| 16 ++- block/qcow2.h |5 +++- block/snapshot.c | 60

[Qemu-devel] [PATCH V5 5/5] qemu-iotests: add test for snapshot in qemu-img convert

2013-11-10 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/058 | 19 ++- tests/qemu-iotests/058.out | 12 2 files changed, 30 insertions(+), 1 deletions(-) diff --git a/tests/qemu-iotests/058 b/tests/qemu-iotests/058 index 2d50d97..9e28132

[Qemu-devel] [PATCH V5 4/5] qemu-img: add -l for snapshot in convert

2013-11-10 Thread Wenchao Xia
Now qemu-img convert have similar options as qemu-nbd for internal snapshot. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qemu-img-cmds.hx |2 +- qemu-img.c | 45 - qemu-img.texi| 12 3 files changed, 45

[Qemu-devel] [PATCH V6 2/6] qcow2: add error message in qcow2_write_snapshots()

2013-11-10 Thread Wenchao Xia
The function still returns int since qcow2_snapshot_delete() will return the number. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Max Reitz mre...@redhat.com --- block/qcow2-snapshot.c | 43 +-- 1 files changed, 37 insertions(+), 6

[Qemu-devel] [PATCH V6 1/6] snapshot: add parameter *errp in snapshot create

2013-11-10 Thread Wenchao Xia
The return value is only used for error report before this patch, so change the function protype to return void. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Max Reitz mre...@redhat.com --- block/qcow2-snapshot.c| 30 +- block/qcow2.h

[Qemu-devel] [PATCH V6 6/6] qemu-iotests: add test for qcow2 snapshot

2013-11-10 Thread Wenchao Xia
This test will focus on the low level procedure of qcow2 snapshot operations, now it covers only the create operation. Overlap error paths are not checked since no good way to trigger those errors. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/070 | 216

[Qemu-devel] [PATCH V6 3/6] qcow2: do not free clusters when fail in header update in qcow2_write_snapshots

2013-11-10 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Max Reitz mre...@redhat.com --- block/qcow2-snapshot.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 6a1d9de..70e329e 100644 --- a/block/qcow2

Re: [Qemu-devel] [PATCH] qapi-schema: Update description for NewImageMode

2013-11-07 Thread Wenchao Xia
于 2013/11/8 2:47, Max Reitz 写道: If the NewImageMode is absolute-paths but no backing file is available (e.g., when mirroring a device with an unbacked image), the target image will not be backed either. This patch updates the documentation in qapi-schema.json accordingly. Signed-off-by: Max

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

2013-11-07 Thread Wenchao Xia
Hello, rebase on upstream?

Re: [Qemu-devel] [PATCH v3 0/2] block/drive-mirror: Check for NULL backing_hd

2013-11-06 Thread Wenchao Xia
(-) Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Should we change doc for NewImageMode in qapi-schema.json also?

Re: [Qemu-devel] [PATCH RFC 07/10] qapi script: support direct inheritance for struct

2013-11-06 Thread Wenchao Xia
于 2013/11/6 21:33, Eric Blake 写道: On 11/05/2013 08:20 PM, Wenchao Xia wrote: + 'server': { + '_base': 'NetworkConnectionInfo', Interesting idea for shorthand. However, I would suggest that you pick a different character than '_', since '_' is valid in names. That is, we

[Qemu-devel] [PATCH 2/8] qapi script: report error for default case in union visit

2013-11-06 Thread Wenchao Xia
It is possible to reach default case, when an union have a enum discriminator, so don't abort() but report the error message. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi-visit.py | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH 3/8] qapi script: check correctness of discriminator values in union

2013-11-06 Thread Wenchao Xia
It will check whether the values specified are written correctly when discriminator is a pre-defined enum type, which help check whether the schema is in good form. It is allowed, that not every value in enum is used, so does not check that case. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH 5/8] qapi script: use same function to generate enum string

2013-11-06 Thread Wenchao Xia
, although the patch changes it, the final string generated is not changed. The custom function used before will met problem when capitalized discriminator value is introduced. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi-types.py |6 +++--- scripts/qapi-visit.py | 21

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

2013-11-06 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 xiaw...@linux.vnet.ibm.com --- include/qapi/qmp/qerror.h |2 +- scripts/qapi.py | 26 +++--- target-i386/cpu.c

[Qemu-devel] [PATCH 8/8] tests: add cases for inherited struct and union with discriminator

2013-11-06 Thread Wenchao Xia
Test for inherit and complex union. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qapi-schema/qapi-schema-test.json | 25 + tests/qapi-schema/qapi-schema-test.out | 11 ++ tests/test-qmp-input-visitor.c | 152 +++ tests/test-qmp-output

[Qemu-devel] [PATCH 1/8] qapi script: remember enum values

2013-11-06 Thread Wenchao Xia
Later other scripts will need to check the enum values. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- scripts/qapi.py| 18 ++ tests/qapi-schema/comments.out |2 +- tests/qapi-schema/qapi

[Qemu-devel] [PATCH 0/8] qapi script: support enum as discriminator and better enum name

2013-11-06 Thread Wenchao Xia
: Mainly address Eric's comments: fix typo, add patch 2 to allow partly mapping enum value in union, add related test case, remove direct inherit support _base and related test case. Wenchao Xia (8): 1 qapi script: remember enum values 2 qapi script: report error for default case in union visit

[Qemu-devel] [PATCH 6/8] qapi script: not generate hidden enum type for pre-defined enum discriminator

2013-11-06 Thread Wenchao Xia
code. In short, enum type as discriminator is fully supported now. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi-types.py | 18 ++ scripts/qapi-visit.py | 23 --- scripts/qapi.py |4 +++- 3 files changed, 33 insertions

[Qemu-devel] [PATCH 4/8] qapi script: code move for generate_enum_name()

2013-11-06 Thread Wenchao Xia
Later both qapi-types.py and qapi-visit.py need a common function for enum name generation. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi-types.py | 10 -- scripts/qapi.py | 10 ++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git

[Qemu-devel] [PATCH V5 6/6] qemu-iotests: add test for qcow2 snapshot

2013-11-05 Thread Wenchao Xia
This test will focus on the low level procedure of qcow2 snapshot operations, now it covers only the create operation. Overlap error paths are not checked since no good way to trigger those errors. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- tests/qemu-iotests/070 | 214

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