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

2013-11-05 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

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

2013-11-05 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. Wenchao Xia (6): 1 snapshot: add parameter *errp in snapshot create 2 qcow2: add error message in qcow2_write_snapshots() 3 qcow2: do not free clusters

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

2013-11-05 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 --- block/qcow2-snapshot.c| 30 +- block/qcow2.h |4 +++- block/rbd.c

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

2013-11-05 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 V5 5/6] blkdebug: add debug events for snapshot

2013-11-05 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 V5 2/6] qcow2: add error message in qcow2_write_snapshots()

2013-11-05 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 --- block/qcow2-snapshot.c | 43 +-- 1 files changed, 37 insertions(+), 6 deletions(-) diff --git a/block/qcow2

[Qemu-devel] [PATCH RFC 05/10] qapi script: use same function to generate enum string

2013-11-05 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 |8

[Qemu-devel] [PATCH RFC 03/10] qapi script: check correctness of discriminator values in union

2013-11-05 Thread Wenchao Xia
It will check whether the values specfied are wrotten 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 do not check that case. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH RFC 04/10] qapi script: code move for generate_enum_name()

2013-11-05 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 RFC 06/10] qapi script: not generate hidden enum type for pre-defined enum discriminator

2013-11-05 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 | 19 ++- scripts/qapi.py |4 +++- 3 files changed, 31 insertions(+), 10

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

2013-11-05 Thread Wenchao Xia
Now it is possible to inherit another struct inside data directly, which saves trouble to define trivial structure. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- docs/qapi-code-gen.txt | 21 + scripts/qapi-visit.py | 14 ++ 2 files changed, 31

[Qemu-devel] [PATCH RFC 01/10] qapi: fix memleak by add implict struct functions in dealloc visitor

2013-11-05 Thread Wenchao Xia
Otherwise they are leaked in a qap_free_STRUCTURE() call. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Cc: qemu-sta...@nongnu.org --- qapi/qapi-dealloc-visitor.c | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/qapi/qapi-dealloc-visitor.c b

[Qemu-devel] [PATCH RFC 09/10] tests: fix memleak in error path test for input visitor

2013-11-05 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Cc: qemu-sta...@nongnu.org --- tests/test-qmp-input-visitor.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tests/test-qmp-input-visitor.c b/tests/test-qmp-input-visitor.c index 0beb8fb..1e1c6fa 100644 --- a/tests

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

2013-11-05 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 | 36 + tests/qapi-schema/qapi-schema-test.out | 15 ++ tests/test-qmp-input-visitor.c | 188 tests/test-qmp-output

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

2013-11-05 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 RFC 02/10] qapi script: remember enum values

2013-11-05 Thread Wenchao Xia
Later other script will need to check the enum values. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- scripts/qapi.py| 18 ++ tests/qapi-schema/comments.out |2 +- tests/qapi-schema/qapi-schema-test.out |4 +++- 3 files changed

[Qemu-devel] [PATCH RFC 00/10] qapi script: support enum as discriminator and other improves

2013-11-05 Thread Wenchao Xia
Patch 1 and 9 fix two memleak issue. Patch 2-6 add support for enum type as discriminator Patch 7 add _base support which can reduce number of defined structure Patch 8 fix enum name generation issue, now AIOContext-AIO_CONTEXT, X86CPU- X86_CPU. Patch 10 are a butch of test cases. Wenchao Xia (10

Re: [Qemu-devel] [PATCH v2 2/2] qemu-iotests: Add test for unbacked mirroring

2013-11-05 Thread Wenchao Xia
于 2013/11/5 8:35, Max Reitz 写道: Add a new test for mirroring unbacked images in absolute-paths mode. This should work, if possible, but most importantly, qemu should never crash. Signed-off-by: Max Reitz mre...@redhat.com --- tests/qemu-iotests/070 | 91

Re: [Qemu-devel] [PATCH RFC 09/10] tests: fix memleak in error path test for input visitor

2013-11-05 Thread Wenchao Xia
于 2013/11/5 21:20, Eric Blake 写道: On 11/04/2013 05:37 PM, Wenchao Xia wrote: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Cc: qemu-sta...@nongnu.org --- tests/test-qmp-input-visitor.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) Reviewed-by: Eric Blake ebl

[Qemu-devel] [PATCH for-1.7 2/2] tests: fix memleak in error path test for input visitor

2013-11-05 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com Cc: qemu-sta...@nongnu.org --- tests/test-qmp-input-visitor.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tests/test-qmp-input-visitor.c b/tests/test-qmp-input-visitor.c

[Qemu-devel] [PATCH for-1.7 1/2] qapi: fix memleak by adding implict struct functions in dealloc visitor

2013-11-05 Thread Wenchao Xia
Otherwise member base is leaked in a qapi_free_STRUCTURE() call. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com Cc: qemu-sta...@nongnu.org --- qapi/qapi-dealloc-visitor.c | 20 1 files changed, 20 insertions(+), 0 deletions

[Qemu-devel] [PATCH for-1.7 0/2] fix qapi mem leaks

2013-11-05 Thread Wenchao Xia
The bugfix patches are picked up from RFC series: http://lists.nongnu.org/archive/html/qemu-devel/2013-11/msg00363.html Wenchao Xia (2): qapi: fix memleak by adding implict struct functions in dealloc visitor tests: fix memleak in error path test for input visitor qapi/qapi-dealloc

Re: [Qemu-devel] [PATCH RFC 03/10] qapi script: check correctness of discriminator values in union

2013-11-05 Thread Wenchao Xia
于 2013/11/5 21:25, Eric Blake 写道: On 11/04/2013 05:37 PM, Wenchao Xia wrote: It will check whether the values specfied are wrotten correctly when s/specfied/specified/ s/wrotten/written/ discriminator is a pre-defined enum type, which help check whether the schema is in good form

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

2013-11-05 Thread Wenchao Xia
于 2013/11/5 21:41, Eric Blake 写道: On 11/04/2013 05:37 PM, Wenchao Xia wrote: Now it is possible to inherit another struct inside data directly, which saves trouble to define trivial structure. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- docs/qapi-code-gen.txt | 21

Re: [Qemu-devel] [PATCH 2/6] qapi: rename MonitorEvent to QEvent

2013-11-05 Thread Wenchao Xia
于 2013/11/5 22:06, Luiz Capitulino 写道: On Tue, 05 Nov 2013 13:31:09 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013/11/5 10:51, Luiz Capitulino 写道: On Tue, 05 Nov 2013 10:17:28 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013/11/4 21:33, Luiz Capitulino 写道: On Mon, 04

Re: [Qemu-devel] [PATCH 2/6] qapi: rename MonitorEvent to QEvent

2013-11-04 Thread Wenchao Xia
于 2013/11/4 21:33, Luiz Capitulino 写道: On Mon, 04 Nov 2013 09:59:50 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013/11/1 22:02, Luiz Capitulino 写道: On Mon, 21 Oct 2013 10:16:01 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: Signed-off-by: Wenchao Xia xiaw

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

2013-11-04 Thread Wenchao Xia
于 2013/11/5 3:46, Eric Blake 写道: On 11/03/2013 06:48 PM, Wenchao Xia wrote: On 14.10.2013 23:52, Wenchao Xia wrote: The function still returns int since qcow2_snapshot_delete() will return the number. @@ -227,24 +239,40 @@ static int qcow2_write_snapshots(BlockDriverState *bs

Re: [Qemu-devel] [PATCH 2/6] qapi: rename MonitorEvent to QEvent

2013-11-04 Thread Wenchao Xia
于 2013/11/5 10:51, Luiz Capitulino 写道: On Tue, 05 Nov 2013 10:17:28 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013/11/4 21:33, Luiz Capitulino 写道: On Mon, 04 Nov 2013 09:59:50 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: 于 2013/11/1 22:02, Luiz Capitulino 写道: On Mon, 21

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

2013-11-03 Thread Wenchao Xia
于 2013/11/2 20:39, Max Reitz 写道: On 14.10.2013 23:52, Wenchao Xia wrote: 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 --- block/qcow2-snapshot.c| 27

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

2013-11-03 Thread Wenchao Xia
On 14.10.2013 23:52, Wenchao Xia wrote: The function still returns int since qcow2_snapshot_delete() will return the number. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qcow2-snapshot.c | 48 ++-- 1 files changed, 42

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

2013-11-03 Thread Wenchao Xia
于 2013/11/2 21:56, Max Reitz 写道: On 02.11.2013 14:04, Max Reitz wrote: On 14.10.2013 23:52, Wenchao Xia wrote: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qcow2-snapshot.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/block/qcow2

Re: [Qemu-devel] [PATCH 0/6] qapi: generate event defines automatically

2013-11-03 Thread Wenchao Xia
于 2013/11/1 22:28, Luiz Capitulino 写道: On Mon, 21 Oct 2013 10:15:59 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: This series move the event define to qapi code, so later other components could use it easily, it also make monitor code less and easier to decouple with other code. Yes

Re: [Qemu-devel] [PATCH 2/6] qapi: rename MonitorEvent to QEvent

2013-11-03 Thread Wenchao Xia
于 2013/11/1 22:02, Luiz Capitulino 写道: On Mon, 21 Oct 2013 10:16:01 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block.c|2 +- include/block/block_int.h |2 +- include/monitor/monitor.h |6

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

2013-10-31 Thread Wenchao Xia
于 2013/10/15 5:52, Wenchao Xia 写道: V2: 1: all fail case will goto fail section. 2: add the goto code. v3: Address Stefan's comments: 2: don't goto fail after allocation failure. 3: use sn-l1size correctly in qcow2_free_cluster(). 4-7: add test case to verify the error

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

2013-10-31 Thread Wenchao Xia
于 2013/10/11 10:33, Wenchao Xia 写道: This series allow user to read internal snapshot's contents without qemu-img convert. V2: Address Stefan's comments: 02: add 'fall through' comments in the case statement. 03: add doc about the difference of internal snapshot and backing chain

Re: [Qemu-devel] [PATCH 3/6] qapi: rename prefix QEVENT to Q_EVENT

2013-10-30 Thread Wenchao Xia
于 2013/10/30 0:09, Eric Blake 写道: On 10/28/2013 11:22 PM, Wenchao Xia wrote: MONITOR_EVENT seems tide to monitor too much, since it will be present in qapi-schema, I think Q_EVENT_ or QMP_EVENT_KIND would be better? I don't have a strong enough opinion on the bikeshed color. MONITOR_EVENT

Re: [Qemu-devel] [PATCH 3/6] qapi: rename prefix QEVENT to Q_EVENT

2013-10-30 Thread Wenchao Xia
于 2013/10/30 2:18, Kevin Wolf 写道: Am 21.10.2013 um 22:41 hat Eric Blake geschrieben: On 10/21/2013 03:16 AM, Wenchao Xia wrote: The define will be moved to qapi-schema.json later, so rename the prefix to match its naming style. Wouldn't it be simpler to fix the code generator to special case

Re: [Qemu-devel] [PATCH 6/6] qapi: add doc for QEvent

2013-10-30 Thread Wenchao Xia
于 2013/10/30 7:02, Eric Blake 写道: On 10/22/2013 06:37 PM, Wenchao Xia wrote: Hi, here is my draft for qapi-schema.json, please have a look. Note: 1 it requires directly support of 'base', so I will sent additonal patch support it by key word '_base' in 'data' contents. 2 some define not labeled

Re: [Qemu-devel] [PATCH 3/6] qapi: rename prefix QEVENT to Q_EVENT

2013-10-30 Thread Wenchao Xia
于 2013/10/30 19:55, Paolo Bonzini 写道: Il 30/10/2013 08:27, Wenchao Xia ha scritto: 于 2013/10/30 2:18, Kevin Wolf 写道: Am 21.10.2013 um 22:41 hat Eric Blake geschrieben: On 10/21/2013 03:16 AM, Wenchao Xia wrote: The define will be moved to qapi-schema.json later, so rename the prefix to match

Re: [Qemu-devel] [PATCH 3/6] qapi: rename prefix QEVENT to Q_EVENT

2013-10-28 Thread Wenchao Xia
于 2013/10/28 18:44, Paolo Bonzini 写道: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 21/10/2013 22:41, Eric Blake ha scritto: On 10/21/2013 03:16 AM, Wenchao Xia wrote: The define will be moved to qapi-schema.json later, so rename the prefix to match its naming style. Wouldn't

Re: [Qemu-devel] [PATCH 0/6] qapi: generate event defines automatically

2013-10-25 Thread Wenchao Xia
Hi, Markus I am coding V2 which support event in qapi-schema, and just remember it is on your TODO list. Is it OK to let me implement it instead as V2?

Re: [Qemu-devel] [PATCH 6/6] qapi: add doc for QEvent

2013-10-23 Thread Wenchao Xia
Take another think, I think I may use past tense through the doc, but with more carefully meaning, such as: the system has enter powerdown state. If you agree with the tense, I'd like sent the reformed doc in the following, before respin. Indeed, which is why separating the docs from

Re: [Qemu-devel] [PATCH 6/6] qapi: add doc for QEvent

2013-10-22 Thread Wenchao Xia
于 2013/10/22 5:00, Eric Blake 写道: On 10/21/2013 03:16 AM, Wenchao Xia wrote: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qapi-schema.json | 56 ++ 1 files changed, 56 insertions(+), 0 deletions(-) Incomplete. Now that you

Re: [Qemu-devel] [PATCH 6/6] qapi: add doc for QEvent

2013-10-22 Thread Wenchao Xia
于 2013/10/22 14:55, Wenchao Xia 写道: 于 2013/10/22 5:00, Eric Blake 写道: On 10/21/2013 03:16 AM, Wenchao Xia wrote: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qapi-schema.json | 56 ++ 1 files changed, 56 insertions(+), 0

Re: [Qemu-devel] [PATCH 13/13] stubs: do not call monitor_printf()

2013-10-21 Thread Wenchao Xia
于 2013/10/18 17:52, Paolo Bonzini 写道: Il 18/10/2013 03:11, Wenchao Xia ha scritto: stubs/pci-drive-host-add.o is packaged together with /stubs/mon-printf.o so it would not work normal, remove it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- stubs/pci-drive-hot-add.c |1 - 1

[Qemu-devel] [PATCH 3/6] qapi: rename prefix QEVENT to Q_EVENT

2013-10-21 Thread Wenchao Xia
The define will be moved to qapi-schema.json later, so rename the prefix to match its naming style. Also fixed code style error reported in spice-core.c. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- balloon.c |2 +- block.c |4 +- block

[Qemu-devel] [PATCH 1/6] block: use type MonitorEvent directly

2013-10-21 Thread Wenchao Xia
block_int.h included monitor.h, so it knows the typedef. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block.c |2 +- include/block/block_int.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH 0/6] qapi: generate event defines automatically

2013-10-21 Thread Wenchao Xia
? I hope to state those clearly in the doc, so I would be appreciate if you have comments on the doc. Wenchao Xia (6): 1 block: use type MonitorEvent directly 2 qapi: rename MonitorEvent to QEvent 3 qapi: rename prefix QEVENT to Q_EVENT 4 qapi: move event defines to qapi-schema.json 5 qapi

[Qemu-devel] [PATCH 2/6] qapi: rename MonitorEvent to QEvent

2013-10-21 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block.c|2 +- include/block/block_int.h |2 +- include/monitor/monitor.h |6 +++--- monitor.c | 12 ++-- stubs/mon-protocol-event.c |2 +- ui/vnc.c |2

[Qemu-devel] [PATCH 4/6] qapi: move event defines to qapi-schema.json

2013-10-21 Thread Wenchao Xia
They are defined with capitals for compatibility, see monitor_event_names in monitor.c, which was used to set the event strings. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- include/monitor/monitor.h | 37 - qapi-schema.json | 37

[Qemu-devel] [PATCH 6/6] qapi: add doc for QEvent

2013-10-21 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qapi-schema.json | 56 ++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index fbc1fab..0f966ab 100644 --- a/qapi-schema.json +++ b

[Qemu-devel] [PATCH 5/6] qapi: remove var monitor_event_names[]

2013-10-21 Thread Wenchao Xia
Use the generated table in qapi-types.h. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c | 36 ++-- 1 files changed, 2 insertions(+), 34 deletions(-) diff --git a/monitor.c b/monitor.c index b2c64de..7b8bd5e 100644 --- a/monitor.c +++ b

Re: [Qemu-devel] [PATCH 3/6] qapi: rename prefix QEVENT to Q_EVENT

2013-10-21 Thread Wenchao Xia
于 2013/10/22 4:41, Eric Blake 写道: On 10/21/2013 03:16 AM, Wenchao Xia wrote: The define will be moved to qapi-schema.json later, so rename the prefix to match its naming style. Wouldn't it be simpler to fix the code generator to special case QEvent to turn into QEVENT, instead of having to go

Re: [Qemu-devel] [PATCH 6/6] qapi: add doc for QEvent

2013-10-21 Thread Wenchao Xia
于 2013/10/22 5:00, Eric Blake 写道: On 10/21/2013 03:16 AM, Wenchao Xia wrote: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qapi-schema.json | 56 ++ 1 files changed, 56 insertions(+), 0 deletions(-) Incomplete. Now that you

Re: [Qemu-devel] [PATCH 02/13] block: do not include monitor.h in block.c

2013-10-20 Thread Wenchao Xia
于 2013/10/18 17:36, Paolo Bonzini 写道: Il 18/10/2013 03:11, Wenchao Xia ha scritto: block_int.h already included it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff

Re: [Qemu-devel] [PATCH 03/13] qapi: move MonitorEvent define

2013-10-20 Thread Wenchao Xia
于 2013/10/18 20:38, Eric Blake 写道: On 10/18/2013 03:36 AM, Paolo Bonzini wrote: Il 18/10/2013 03:11, Wenchao Xia ha scritto: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- include/monitor/monitor.h | 38 +- include/qapi/qmp/qevent.h | 66

Re: [Qemu-devel] [PATCH 05/13] error: define struct Error in only one place

2013-10-20 Thread Wenchao Xia
于 2013/10/18 19:22, Markus Armbruster 写道: Paolo Bonzini pbonz...@redhat.com writes: Il 18/10/2013 03:11, Wenchao Xia ha scritto: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- include/qapi/error.h |5 - qobject/qerror.c |7 --- util/error.c |6

Re: [Qemu-devel] [PATCH 08/13] error: don't set sep when print progname

2013-10-20 Thread Wenchao Xia
于 2013/10/18 19:40, Markus Armbruster 写道: Paolo Bonzini pbonz...@redhat.com writes: Il 18/10/2013 03:11, Wenchao Xia ha scritto: The behavior to set sep brings trouble to modification later, the logic is not changed by add tailing space in fprintf(). Signed-off-by: Wenchao Xia xiaw

Re: [Qemu-devel] [PATCH 09/13] error: print progname with error_vprintf()

2013-10-20 Thread Wenchao Xia
于 2013/10/18 17:44, Paolo Bonzini 写道: Il 18/10/2013 03:11, Wenchao Xia ha scritto: This remove additional code path about where to print the error, error_vprintf() is only the controller now, making future change easier. The logic is not changed since when cur_mon = NULL, error_vprintf

Re: [Qemu-devel] [PATCH 10/13] qerror: deref once in qerror_report()

2013-10-20 Thread Wenchao Xia
于 2013/10/18 17:46, Paolo Bonzini 写道: Il 18/10/2013 03:11, Wenchao Xia ha scritto: Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qobject/qerror.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/qobject/qerror.c b/qobject/qerror.c index 5b487f3..685167a

Re: [Qemu-devel] [PATCH 12/13] monitor: hide *cur_mon in monitor_get_fd()

2013-10-20 Thread Wenchao Xia
于 2013/10/18 17:51, Paolo Bonzini 写道: Il 18/10/2013 03:11, Wenchao Xia ha scritto: All existing caller are using *cur_mon as its parameter, and *cur_mon is an internal variable which used inside monitor.c. This patch reduce the exposing of details in monitor.c, by introduce a new function

[Qemu-devel] [PATCH 01/13] block: use type MonitorEvent directly

2013-10-18 Thread Wenchao Xia
block_int.h included monitor.h, so it knows the typedef. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block.c |2 +- include/block/block_int.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH 07/13] error: make error_print_loc() static

2013-10-18 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- include/qemu/error-report.h |1 - util/qemu-error.c |2 +- 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h index 5297e65..a08ee95 100644

[Qemu-devel] [PATCH 02/13] block: do not include monitor.h in block.c

2013-10-18 Thread Wenchao Xia
block_int.h already included it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/block.c b/block.c index 2c15e5d..e92a556 100644 --- a/block.c +++ b/block.c

[Qemu-devel] [PATCH 05/13] error: define struct Error in only one place

2013-10-18 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- include/qapi/error.h |5 - qobject/qerror.c |7 --- util/error.c |6 -- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/include/qapi/error.h b/include/qapi/error.h index 7d4c696..8688aaf

[Qemu-devel] [PATCH 03/13] qapi: move MonitorEvent define

2013-10-18 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- include/monitor/monitor.h | 38 +- include/qapi/qmp/qevent.h | 66 + include/qapi/qmp/types.h |1 + 3 files changed, 68 insertions(+), 37 deletions(-) create

[Qemu-devel] [PATCH 09/13] error: print progname with error_vprintf()

2013-10-18 Thread Wenchao Xia
This remove additional code path about where to print the error, error_vprintf() is only the controller now, making future change easier. The logic is not changed since when cur_mon = NULL, error_vprintf() will still print to stderr. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH 04/13] qapi: rename MonitorEvent to QEvent

2013-10-18 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block.c|2 +- include/block/block_int.h |2 +- include/monitor/monitor.h |2 +- include/qapi/qmp/qevent.h |4 ++-- monitor.c | 12

[Qemu-devel] [PATCH 10/13] qerror: deref once in qerror_report()

2013-10-18 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qobject/qerror.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/qobject/qerror.c b/qobject/qerror.c index 5b487f3..685167a 100644 --- a/qobject/qerror.c +++ b/qobject/qerror.c @@ -77,7 +77,6 @@ static void

[Qemu-devel] [PATCH 13/13] stubs: do not call monitor_printf()

2013-10-18 Thread Wenchao Xia
stubs/pci-drive-host-add.o is packaged together with /stubs/mon-printf.o so it would not work normal, remove it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- stubs/pci-drive-hot-add.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/stubs/pci-drive-hot-add.c

[Qemu-devel] [PATCH 12/13] monitor: hide *cur_mon in monitor_get_fd()

2013-10-18 Thread Wenchao Xia
All existing caller are using *cur_mon as its parameter, and *cur_mon is an internal variable which used inside monitor.c. This patch reduce the exposing of details in monitor.c, by introduce a new function monitor_get_fd_cur() and make old one static. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH 11/13] qerror: folder qerror emit logic

2013-10-18 Thread Wenchao Xia
The code about how to print the message, is foldered into a function, so if we want to change the print behavior in the future, just modify that function only. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- qobject/qerror.c | 28 1 files changed, 16

[Qemu-devel] [PATCH 08/13] error: don't set sep when print progname

2013-10-18 Thread Wenchao Xia
The behavior to set sep brings trouble to modification later, the logic is not changed by add tailing space in fprintf(). Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- util/qemu-error.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/util/qemu-error.c b

[Qemu-devel] [PATCH 06/13] error: remove error_printf_unless_qmp()

2013-10-18 Thread Wenchao Xia
monitor_vprintf() is called in the code path, and it will not print when monitor is in qmp mode, so checking monitor mode in error_printf_unless_qmp() is useless, remove it to simplify the code. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hw/usb/bus.c|2 +- hw

[Qemu-devel] [PATCH 00/13] trivial patches for event, error and monitor

2013-10-18 Thread Wenchao Xia
: Remove stub mon-protocol-event for block Wenchao Xia (13): 1 block: use type MonitorEvent directly 2 block: do not include monitor.h in block.c 3 qapi: move MonitorEvent define 4 qapi: rename MonitorEvent to QEvent 5 error: define struct Error in only one place 6 error: remove

Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()

2013-10-16 Thread Wenchao Xia
于 2013/10/15 18:07, mike 写道: On 10/15/2013 04:58 PM, Kevin Wolf wrote: Am 15.10.2013 um 05:38 hat mike geschrieben: On 10/14/2013 10:36 PM, Markus Armbruster wrote: Mike Qiu qiud...@linux.vnet.ibm.com writes: Without this, output of 'info block' scsi0-hd0: /images/f18-ppc64.qcow2 (qcow2)

Re: [Qemu-devel] [PATCH] hmp: Add '\n' in monitor_printf()

2013-10-16 Thread Wenchao Xia
于 2013/10/16 15:47, Markus Armbruster 写道: Wenchao Xiaxiaw...@linux.vnet.ibm.com writes: 于 2013/10/15 18:07, mike 写道: On 10/15/2013 04:58 PM, Kevin Wolf wrote: Am 15.10.2013 um 05:38 hat mike geschrieben: On 10/14/2013 10:36 PM, Markus Armbruster wrote: Mike Qiuqiud...@linux.vnet.ibm.com

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

2013-10-14 Thread Wenchao Xia
于 2013/10/2 20:28, Stefan Hajnoczi 写道: On Mon, Sep 09, 2013 at 10:57:55AM +0800, Wenchao Xia wrote: V2: 1: all fail case will goto fail section. 2: add the goto code. v3: Address Stefan's comments: 2: don't goto fail after allocation failure. 3: use sn-l1size correctly

Re: [Qemu-devel] [PATCH V3 6/7] qcow2: print message for error path in snapshot creation

2013-10-14 Thread Wenchao Xia
于 2013/10/2 20:23, Stefan Hajnoczi 写道: On Mon, Sep 30, 2013 at 04:08:53PM -0600, Eric Blake wrote: On 09/08/2013 08:58 PM, Wenchao Xia wrote: The message will be print out with a macro enabled, which can s/print/printed/ be used to check which error path is taken. Signed-off-by: Wenchao

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

2013-10-14 Thread Wenchao Xia
于 2013/10/1 6:28, Eric Blake 写道: On 09/08/2013 08:58 PM, 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

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

2013-10-14 Thread Wenchao Xia
determined debug printf message. 5: squashed patches that add and use debug events. 6: added comments about test only on Linux. Wenchao Xia (6): 1 snapshot: add parameter *errp in snapshot create 2 qcow2: add error message in qcow2_write_snapshots() 3 qcow2: do not free clusters when fail

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

2013-10-14 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 --- block/qcow2-snapshot.c| 27 +++ block/qcow2.h |4 +++- block/rbd.c

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

2013-10-14 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/068 | 214

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

2013-10-14 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.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 c933b7f..6d0ffd4 100644 --- a/block/qcow2-snapshot.c +++ b/block

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

2013-10-14 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 --- block/qcow2-snapshot.c | 48 ++-- 1 files changed, 42 insertions(+), 6 deletions(-) diff --git a/block

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

2013-10-14 Thread Wenchao Xia
Some code in qcow2-snapshot.c directly access bs-file, so in those points error can't be injected by other events. Since the code in qcow2-snapshot.c is qcow2's internal detail similar as L1 table, so add some debug events. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block

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

2013-10-14 Thread Wenchao Xia
Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qcow2-snapshot.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 4bd494b..c933b7f 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c

Re: [Qemu-devel] [PATCH 2/2] aio: add aio_context_acquire() and aio_context_release()

2013-10-11 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH 1/2] rfifolock: add recursive FIFO lock

2013-10-11 Thread Wenchao Xia
Logic looks fine to me, only a minor comments. QemuMutex does not guarantee fairness and cannot be acquired recursively: Fairness means each locker gets a turn and the scheduler cannot cause starvation. Recursive locking is useful for composition, it allows a sequence of locking

Re: [Qemu-devel] [PATCH V2 0/2] build: trivial patches for test*

2013-10-11 Thread Wenchao Xia
于 2013/9/26 8:42, Wenchao Xia 写道: v2: Address Michael's comments: 01: better commit message to tip what it is doing. Wenchao Xia (2): 1 tests: build the helper program by default 2 build: add command check-clean Makefile |1 - tests/Makefile | 16 ++-- 2

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

2013-10-11 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 V4 0/5] export internal snapshot by qemu-nbd

2013-10-11 Thread Wenchao Xia
as deprecated, added doc for them. 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 -l for snapshot in convert 5 qemu-iotests: add test

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

2013-10-11 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 V4 2/5] qemu-nbd: support internal snapshot export

2013-10-11 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 V4 4/5] qemu-img: add -l for snapshot in convert

2013-10-11 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 V4 5/5] qemu-iotests: add test for snapshot in qemu-img convert

2013-10-11 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 5b821cf..d4987ae

Re: [Qemu-devel] [PATCH 1/2] rfifolock: add recursive FIFO lock

2013-10-11 Thread Wenchao Xia
于 2013/10/11 21:35, Stefan Hajnoczi 写道: On Fri, Oct 11, 2013 at 04:55:31PM +0800, Wenchao Xia wrote: +/* Recursive FIFO lock + * + * This lock provides more features than a plain mutex: + * + * 1. Fairness - enforces FIFO order. + * 2. Nesting - can be taken recursively. + * 3. Contention

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

2013-10-10 Thread Wenchao Xia
于 2013/10/2 0:08, Paolo Bonzini 写道: Il 26/09/2013 02:16, Wenchao Xia ha scritto: 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 Xiaxiaw...@linux.vnet.ibm.com --- block/snapshot.c

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

2013-10-10 Thread Wenchao Xia
于 2013/10/1 22:49, Eric Blake 写道: On 09/25/2013 06:16 PM, Wenchao Xia wrote: Signed-off-by: Wenchao Xiaxiaw...@linux.vnet.ibm.com --- qemu-nbd.c| 11 ++- qemu-nbd.texi | 11 ++- 2 files changed, 20 insertions(+), 2 deletions(-) This should be squashed into 2/7

Re: [Qemu-devel] [PATCH V3 5/7] qemu-img: add -L for snapshot in convert

2013-10-10 Thread Wenchao Xia
于 2013/10/2 0:07, Paolo Bonzini 写道: Il 26/09/2013 02:16, Wenchao Xia ha scritto: +c = getopt(argc, argv, f:O:B:s:hce6o:pS:t:qnL:); if (c == -1) { break; } @@ -1183,6 +1184,9 @@ static int img_convert(int argc, char **argv) case 's

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