Re: [Qemu-devel] [PATCH V11 02/17] block: distinguish id and name in bdrv_find_snapshot()

2013-04-10 Thread Wenchao Xia
于 2013-4-10 23:21, Markus Armbruster 写道: Wenchao Xia xiaw...@linux.vnet.ibm.com writes: To make it clear about id and name in searching, the API is changed a bit to distinguish them, and caller can choose to search by id or name. Searching will be done with higher priority of id

Re: [Qemu-devel] [PATCH V11 05/17] block: add snapshot info query function bdrv_query_snapshot_info_list()

2013-04-10 Thread Wenchao Xia
于 2013-4-10 23:11, Markus Armbruster 写道: Eric Blake ebl...@redhat.com writes: On 04/02/2013 05:47 AM, Wenchao Xia wrote: This patch adds function bdrv_query_snapshot_info_list(), which will retrieve snapshot info of an image in qmp object format. The implementation is based on the code

Re: [Qemu-devel] [PATCH V11 06/17] block: add check for VM snapshot in bdrv_query_snapshot_info_list()

2013-04-10 Thread Wenchao Xia
于 2013-4-10 23:19, Markus Armbruster 写道: Wenchao Xia xiaw...@linux.vnet.ibm.com writes: This patch adds a parameter to tell whether return valid snapshots for whole VM only. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed

Re: [Qemu-devel] [PATCH V11 00/17] qmp/hmp interfaces for internal snapshot info

2013-04-06 Thread Wenchao Xia
to show verbose info. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-03 Thread Wenchao Xia
Xia -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 3/3] block: change rollback sequence in qmp_transaction

2013-04-03 Thread Wenchao Xia
于 2013-4-3 17:03, Kevin Wolf 写道: Am 03.04.2013 um 07:35 hat Wenchao Xia geschrieben: 于 2013-4-2 21:59, Kevin Wolf 写道: Am 01.04.2013 um 12:01 hat Wenchao Xia geschrieben: Last operaton should be cancelled first. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Should it? This commit

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-03 Thread Wenchao Xia
于 2013-4-3 17:02, Wenchao Xia 写道: No, if bdrv_snapshot_delete() can fail, you need to split it in two parts: one that can fail, and one that cannot. If you cannot, then there are two possibilities: - if the failures are minor and could be repaired with qemu-img check -r (e.g. lost clusters

Re: [Qemu-devel] [PATCH V11 05/17] block: add snapshot info query function bdrv_query_snapshot_info_list()

2013-04-02 Thread Wenchao Xia
于 2013-4-3 9:17, Eric Blake 写道: On 04/02/2013 05:47 AM, Wenchao Xia wrote: This patch adds function bdrv_query_snapshot_info_list(), which will retrieve snapshot info of an image in qmp object format. The implementation is based on the code moved from qemu-img.c with modification to fit more

Re: [Qemu-devel] [PATCH 3/3] block: change rollback sequence in qmp_transaction

2013-04-02 Thread Wenchao Xia
于 2013-4-2 21:59, Kevin Wolf 写道: Am 01.04.2013 um 12:01 hat Wenchao Xia geschrieben: Last operaton should be cancelled first. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Should it? This commit message does little to convince me. Kevin I think so, if two request

Re: [Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-02 Thread Wenchao Xia
于 2013-4-2 21:55, Kevin Wolf 写道: Am 01.04.2013 um 12:01 hat Wenchao Xia geschrieben: Now code for external snapshot are packaged as one case in qmp_transaction, so later other operation could be added. The logic in qmp_transaction is changed a bit: Original code tries to create all images

Re: [Qemu-devel] [PATCH V10 11/17] qmp: add ImageInfo in BlockDeviceInfo used by query-block

2013-04-02 Thread Wenchao Xia
于 2013-4-2 16:09, Kevin Wolf 写道: Am 29.03.2013 um 03:35 hat Wenchao Xia geschrieben: 于 2013-3-28 17:54, Kevin Wolf 写道: Am 22.03.2013 um 15:19 hat Wenchao Xia geschrieben: Now image info will be retrieved as an embbed json object inside BlockDeviceInfo, backing chain info and all related

[Qemu-devel] [PATCH V11 03/17] qemu-img: remove unused parameter in collect_image_info()

2013-04-02 Thread Wenchao Xia
Parameter *fmt was not used, so remove it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Kevin Wolf kw...@redhat.com --- qemu-img.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/qemu-img.c b/qemu

[Qemu-devel] [PATCH V11 01/17] block: move bdrv_snapshot_find() to block/snapshot.c

2013-04-02 Thread Wenchao Xia
This patch adds block/snapshot.c and then moves the function there. It also fixes small code style errors reported by check script. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Kevin Wolf kw...@redhat.com --- block/Makefile.objs

[Qemu-devel] [PATCH V11 00/17] qmp/hmp interfaces for internal snapshot info

2013-04-02 Thread Wenchao Xia
to dump snapshot info. 16/17: using GString to dump image info. Address Kevin's comments: 11/17: return void for bdrv_query_info(). 17/17: spell fix in help message, using parameter -v to show verbose info. Wenchao Xia (17): 1 block: move bdrv_snapshot_find() to block/snapshot.c 2 block

[Qemu-devel] [PATCH V11 02/17] block: distinguish id and name in bdrv_find_snapshot()

2013-04-02 Thread Wenchao Xia
. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Kevin Wolf kw...@redhat.com --- block/snapshot.c | 46 ++ include/block/snapshot.h |2 +- savevm.c | 10

[Qemu-devel] [PATCH V11 04/17] block: move collect_snapshots() and collect_image_info() to block/qapi.c

2013-04-02 Thread Wenchao Xia
This patch adds block/qapi.c and moves the functions there. To avoid conflict and tip better, macro in header file is BLOCK_QAPI_H instead of QAPI_H. The moving is for making review easier, those functions will be modified and renamed later. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH V11 05/17] block: add snapshot info query function bdrv_query_snapshot_info_list()

2013-04-02 Thread Wenchao Xia
This patch adds function bdrv_query_snapshot_info_list(), which will retrieve snapshot info of an image in qmp object format. The implementation is based on the code moved from qemu-img.c with modification to fit more for qmp based block layer API. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V11 07/17] block: add image info query function bdrv_query_image_info()

2013-04-02 Thread Wenchao Xia
This patch adds function bdrv_query_image_info(), which will retrieve image info in qmp object format. The implementation is based on the code moved from qemu-img.c, but uses block layer function to get snapshot info. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c

[Qemu-devel] [PATCH V11 08/17] block: move qmp_query_block() and bdrv_query_info() to block/qapi.c

2013-04-02 Thread Wenchao Xia
This is a code move patch, except in qmp_query_block bdrv_next(bs) is used instead of direct traverse of global array 'bdrv_states'. This patch also fix code style error reported by check script. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Kevin Wolf kw...@redhat.com

[Qemu-devel] [PATCH V11 10/17] qmp: add recursive member in ImageInfo

2013-04-02 Thread Wenchao Xia
New member *backing-image is added to reflect the backing chain status. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Kevin Wolf kw...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qapi.c |6 +- qapi-schema.json |5 - 2 files changed, 9

[Qemu-devel] [PATCH V11 06/17] block: add check for VM snapshot in bdrv_query_snapshot_info_list()

2013-04-02 Thread Wenchao Xia
This patch adds a parameter to tell whether return valid snapshots for whole VM only. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Kevin Wolf kw...@redhat.com --- block/qapi.c | 39

[Qemu-devel] [PATCH V11 11/17] qmp: add ImageInfo in BlockDeviceInfo used by query-block

2013-04-02 Thread Wenchao Xia
Now image info will be retrieved as an embbed json object inside BlockDeviceInfo, backing chain info and all related internal snapshot info can be got in the enhanced recursive structure of ImageInfo. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c | 38

[Qemu-devel] [PATCH V11 12/17] block: move bdrv_snapshot_dump() and dump_human_image_info() to block/qapi.c

2013-04-02 Thread Wenchao Xia
They are needed later in hmp command, dump_human_image_info() is renamed to bdrv_image_info_dump(). Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block.c | 33 block/qapi.c | 100 + include

[Qemu-devel] [PATCH V11 17/17] hmp: add parameters device and -v for info block

2013-04-02 Thread Wenchao Xia
With these parameters, user can choose the information to be showed, to avoid message flood in the montior. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp.c | 34 -- monitor.c |7 --- 2 files changed, 24 insertions(+), 17 deletions

[Qemu-devel] [PATCH V11 14/17] hmp: add function hmp_info_snapshots()

2013-04-02 Thread Wenchao Xia
the qmp object got to strings in stdout or monitor console. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp.c | 48 hmp.h |1 + 2 files changed, 49 insertions(+), 0 deletions(-) diff --git a/hmp.c b/hmp.c index dbe9b90..89e1aaf

[Qemu-devel] [PATCH V11 13/17] block: dump to buffer for bdrv_snapshot_dump() and bdrv_image_info_dump()

2013-04-02 Thread Wenchao Xia
This patch would allow hmp use them just like qemu-img, and avoid string truncation. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c | 65 +++--- include/block/qapi.h |4 +- qemu-img.c | 22

[Qemu-devel] [PATCH V11 15/17] hmp: switch snapshot info function to qmp based one

2013-04-02 Thread Wenchao Xia
This patch using new added function in last commit which retrieve info from qmp for snapshot info. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Kevin Wolf kw...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- monitor.c |2 +- savevm.c | 69

[Qemu-devel] [PATCH V11 16/17] hmp: show ImageInfo in 'info block'

2013-04-02 Thread Wenchao Xia
Now human monitor can show image details include internal snapshot info for every block device. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp.c | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/hmp.c b/hmp.c index 89e1aaf..6f93fcd

[Qemu-devel] [PATCH V11 09/17] qmp: add interface query-snapshots

2013-04-02 Thread Wenchao Xia
This interface returns info of valid internal snapshots for whole vm. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Kevin Wolf kw...@redhat.com --- block/qapi.c | 17 qapi-schema.json | 14

[Qemu-devel] [PATCH 0/3] block: make qmp_transaction extendable

2013-04-01 Thread Wenchao Xia
://lists.nongnu.org/archive/html/qemu-devel/2013-01/msg00645.html I can't find a way to split patch 2/3 to smaller ones unless breaking the build, so kepted it as a relative larger patch. Wenchao Xia (3): 1 block: add function deappend() 2 block: adjust qmp_transaction to be extendable 3 block

[Qemu-devel] [PATCH 1/3] block: add function deappend()

2013-04-01 Thread Wenchao Xia
This function should be used to remove contents of active *bs on the top of backing chain, when top *bs was committed to bs-backing_hd or *bs was just appended. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block.c | 66

[Qemu-devel] [PATCH 2/3] block: adjust qmp_transaction to be extendable

2013-04-01 Thread Wenchao Xia
time, and use bdrv_deappend() to rollback on fail. This allows mixing different kind of requests in qmp_transaction() later. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c | 250 +--- 1 files changed, 153 insertions

[Qemu-devel] [PATCH 3/3] block: change rollback sequence in qmp_transaction

2013-04-01 Thread Wenchao Xia
Last operaton should be cancelled first. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- blockdev.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/blockdev.c b/blockdev.c index 75416fb..a24d10e 100644 --- a/blockdev.c +++ b/blockdev.c @@ -954,7 +954,7

Re: [Qemu-devel] [PATCH 3/3] block: change rollback sequence in qmp_transaction

2013-04-01 Thread Wenchao Xia
于 2013-4-1 23:52, Eric Blake 写道: On 04/01/2013 04:01 AM, Wenchao Xia wrote: Last operaton should be cancelled first. s/operaton/operation/ [I don't care enough about US vs. UK to say whether canceled or cancelled looks better] Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH V10 15/17] block: dump to buffer for bdrv_image_info_dump()

2013-04-01 Thread Wenchao Xia
于 2013-4-2 3:17, Eric Blake 写道: On 03/22/2013 08:19 AM, Wenchao Xia wrote: This allow hmp use this function, just like qemu-img. It also returns a pointer now to make it easy to use. -void bdrv_image_info_dump(ImageInfo *info) +GCC_FMT_ATTR(3, 4) +static void snprintf_tail(char **p_buf

Re: [Qemu-devel] [PATCH 0/5] vhost-scsi: Add support for host virtualized target

2013-04-01 Thread Wenchao Xia
mode 100644 hw/vhost-scsi.c create mode 100644 hw/vhost-scsi.h -- Best Regards Wenchao Xia

Re: [Qemu-devel] A crash problem about loadvm

2013-03-31 Thread Wenchao Xia
(fc24f3bd2ed4c97c99ad40e747732ae46dff2009 spice: notify spice server on vm start/stop). Could you give me some advices to debug this problem? -- Best Regards, Jeremy Liu Seems some step missing for spice server, need to check the status in migration. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V10 08/17] block: move qmp_query_block() and bdrv_query_info() to block/qapi.c

2013-03-30 Thread Wenchao Xia
于 2013-3-30 4:10, Eric Blake 写道: On 03/22/2013 08:19 AM, Wenchao Xia wrote: This is a code move patch, except in qmp_query_block bdrv_next(bs) is used instead of direct traverse of global array 'bdrv_states'. Mixing code motion and a code change isn't always the best, but at least you were

Re: [Qemu-devel] [PATCH V10 12/17] hmp: add function hmp_info_snapshots()

2013-03-30 Thread Wenchao Xia
于 2013-3-30 7:04, Eric Blake 写道: On 03/22/2013 08:19 AM, Wenchao Xia wrote: This function will simply call qmp interface qmp_query_snapshots() added in last commit and then dump information in monitor console. To get snapshot info, Now qemu and qemu-img both call block layer function

Re: [Qemu-devel] [PATCH V10 11/17] qmp: add ImageInfo in BlockDeviceInfo used by query-block

2013-03-28 Thread Wenchao Xia
于 2013-3-28 17:54, Kevin Wolf 写道: Am 22.03.2013 um 15:19 hat Wenchao Xia geschrieben: Now image info will be retrieved as an embbed json object inside BlockDeviceInfo, backing chain info and all related internal snapshot info can be got in the enhanced recursive structure of ImageInfo

Re: [Qemu-devel] [PATCH V10 17/17] hmp: add parameter device and -b for info block

2013-03-28 Thread Wenchao Xia
于 2013-3-28 19:09, Kevin Wolf 写道: Am 22.03.2013 um 15:19 hat Wenchao Xia geschrieben: With these parameters, user can choose the information to be showed, to avoid message flood in the montior. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Aha, so here you actually introduce

Re: [Qemu-devel] [PATCH 2/2] Monitor: Make output buffer dynamic

2013-03-27 Thread Wenchao Xia
Hi, Luiz Personally I hope reduce the dynamic allocated buffer which brings fragments and unexpected memory grow. Instead, how about sacrifice some time to wait output complete, since monitor is not time critical? in this case static buffer's size can decide how many work can be postponded.

Re: [Qemu-devel] [PATCH 2/2] qtest: use synchronous I/O for char device

2013-03-27 Thread Wenchao Xia
Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Peter reported that rtc-test would periodically hang. It turns out this was due to an EAGAIN occurring on qemu_chr_fe_write. Instead of heavily refactoring qtest, just use a synchronous version of the write operation for qemu_chr_fe_write

Re: [Qemu-devel] [PATCH 1/2] char: introduce a blocking version of qemu_chr_fe_write

2013-03-27 Thread Wenchao Xia
) { g_usleep(100) continue; } . } -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 2/2] Monitor: Make output buffer dynamic

2013-03-27 Thread Wenchao Xia
于 2013-3-27 20:27, Luiz Capitulino 写道: On Wed, 27 Mar 2013 14:45:53 +0800 Wenchao Xia xiaw...@linux.vnet.ibm.com wrote: Hi, Luiz Personally I hope reduce the dynamic allocated buffer which brings fragments and unexpected memory grow. Instead, how about sacrifice some time to wait output

Re: [Qemu-devel] coroutine: hung when using gthread backend

2013-03-26 Thread Wenchao Xia
于 2013-3-27 0:21, Stefan Hajnoczi 写道: On Tue, Mar 26, 2013 at 11:03:53AM +0100, Paolo Bonzini wrote: Il 26/03/2013 10:54, Stefan Hajnoczi ha scritto: On Tue, Mar 26, 2013 at 08:03:50AM +0100, Paolo Bonzini wrote: Il 26/03/2013 03:50, Wenchao Xia ha scritto: When I using tcg with coroutine

Re: [Qemu-devel] coroutine: hung when using gthread backend

2013-03-26 Thread Wenchao Xia
tests it? -- PMM It is not enabled by default in configure, so missed in tests. I feel a full regression test suit covering different configure case is missing. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [RFC] qmp interface for save vmstate to image

2013-03-26 Thread Wenchao Xia
) pushing a API to Linux to do method 1, instead of fork(). I'd like to send a RFC to Linux memory mail-list to get feedback. -- Best Regards Wenchao Xia

[Qemu-devel] [PATCH] VMXNET3: initialize rx_ridx to eliminate compile warning

2013-03-25 Thread Wenchao Xia
Gcc report hw/vmxnet3.c:972: error: ‘rx_ridx’ may be used uninitialized in this function, so fix it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hw/vmxnet3.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/vmxnet3.c b/hw/vmxnet3.c index 925be80

[Qemu-devel] coroutine: hung when using gthread backend

2013-03-25 Thread Wenchao Xia
out) at /home/xiawenc/Workdir/Src/qemu/qemu/cpus.c:834 #3 0x760f4851 in start_thread () from /lib64/libpthread.so.0 #4 0x73de567d in clone () from /lib64/libc.so.6 -- Best Regards Wenchao Xia

[Qemu-devel] [PATCH V10 01/17] block: move bdrv_snapshot_find() to block/snapshot.c

2013-03-22 Thread Wenchao Xia
This patch adds block/snapshot.c and then moves the function there. It also fixes small code style errors reported by check script. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/Makefile.objs |1 + block/snapshot.c

[Qemu-devel] [PATCH V10 00/17] qmp/hmp interfaces for internal snapshot info

2013-03-22 Thread Wenchao Xia
/17: check 'bs1 != bs' first as optimization. 8/17, 10/17, 11/17: new patches recusively show image info in the backing chain in command query-block. Wenchao Xia (17): 1 block: move bdrv_snapshot_find() to block/snapshot.c 2 block: distinguish id and name in bdrv_find_snapshot() 3 qemu-img

[Qemu-devel] [PATCH V10 02/17] block: distinguish id and name in bdrv_find_snapshot()

2013-03-22 Thread Wenchao Xia
. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/snapshot.c | 46 ++ include/block/snapshot.h |2 +- savevm.c | 10 +- 3 files changed, 44 insertions(+), 14

[Qemu-devel] [PATCH V10 03/17] qemu-img: remove unused parameter in collect_image_info()

2013-03-22 Thread Wenchao Xia
Parameter *fmt was not used, so remove it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- qemu-img.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 31627b0..937ec01 100644

[Qemu-devel] [PATCH V10 04/17] block: move collect_snapshots() and collect_image_info() to block/qapi.c

2013-03-22 Thread Wenchao Xia
This patch adds block/qapi.c and moves the functions there. To avoid conflict and tip better, macro in header file is BLOCK_QAPI_H instead of QAPI_H. The moving is for making review easier, those functions will be modified and renamed later. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH V10 05/17] block: add snapshot info query function bdrv_query_snapshot_info_list()

2013-03-22 Thread Wenchao Xia
This patch adds function bdrv_query_snapshot_info_list(), which will retrieve snapshot info of an image in qmp object format. The implementation is based on the code moved from qemu-img.c with modification to fit more for qmp based block layer API. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V10 06/17] block: add check for VM snapshot in bdrv_query_snapshot_info_list()

2013-03-22 Thread Wenchao Xia
This patch adds a parameter to tell whether return valid snapshots for whole VM only. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qapi.c | 42 -- include/block/qapi.h |1 + qemu

[Qemu-devel] [PATCH V10 08/17] block: move qmp_query_block() and bdrv_query_info() to block/qapi.c

2013-03-22 Thread Wenchao Xia
This is a code move patch, except in qmp_query_block bdrv_next(bs) is used instead of direct traverse of global array 'bdrv_states'. This patch also fix code style error reported by check script. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block.c | 76

[Qemu-devel] [PATCH V10 09/17] qmp: add interface query-snapshots

2013-03-22 Thread Wenchao Xia
This interface returns info of valid internal snapshots for whole vm. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qapi.c | 17 qapi-schema.json | 14 + qmp-commands.hx | 55

[Qemu-devel] [PATCH V10 10/17] qmp: add recursive member in ImageInfo

2013-03-22 Thread Wenchao Xia
New member *backing-image is added to reflect the backing chain status. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c |6 +- qapi-schema.json |5 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index

[Qemu-devel] [PATCH V10 13/17] hmp: switch snapshot info function to qmp based one

2013-03-22 Thread Wenchao Xia
This patch using new added function in last commit which retrieve info from qmp for snapshot info. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c |2 +- savevm.c | 64 - 2 files changed, 1 insertions(+), 65

[Qemu-devel] [PATCH V10 11/17] qmp: add ImageInfo in BlockDeviceInfo used by query-block

2013-03-22 Thread Wenchao Xia
Now image info will be retrieved as an embbed json object inside BlockDeviceInfo, backing chain info and all related internal snapshot info can be got in the enhanced recursive structure of ImageInfo. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c | 39

[Qemu-devel] [PATCH V10 14/17] block: move dump_human_image_info() to block/qapi.c

2013-03-22 Thread Wenchao Xia
This function is needed later in hmp command, it is also renamed to bdrv_image_info_dump(). Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qapi.c | 67 include/block/qapi.h

[Qemu-devel] [PATCH V10 15/17] block: dump to buffer for bdrv_image_info_dump()

2013-03-22 Thread Wenchao Xia
This allow hmp use this function, just like qemu-img. It also returns a pointer now to make it easy to use. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c | 67 +++-- include/block/qapi.h |2 +- qemu-img.c

[Qemu-devel] [PATCH V10 17/17] hmp: add parameter device and -b for info block

2013-03-22 Thread Wenchao Xia
With these parameters, user can choose the information to be showed, to avoid message flood in the montior. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp.c |7 ++- monitor.c |7 --- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hmp.c b

[Qemu-devel] [PATCH V10 07/17] block: add image info query function bdrv_query_image_info()

2013-03-22 Thread Wenchao Xia
This patch adds function bdrv_query_image_info(), which will retrieve image info in qmp object format. The implementation is based on the code moved from qemu-img.c, but uses block layer function to get snapshot info. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake

[Qemu-devel] [PATCH V10 16/17] hmp: show ImageInfo in 'info block'

2013-03-22 Thread Wenchao Xia
Now human monitor can show image details include internal snapshot info for every block device. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/hmp.c b/hmp.c index c475d65..49f851b

[Qemu-devel] [PATCH V10 12/17] hmp: add function hmp_info_snapshots()

2013-03-22 Thread Wenchao Xia
the qmp object got to strings in stdout or monitor console. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp.c | 42 ++ hmp.h |1 + 2 files changed, 43 insertions(+), 0 deletions(-) diff --git a/hmp.c b/hmp.c index b0a861c..c475d65 100644

Re: [Qemu-devel] [RFC] qmp interface for save vmstate to image

2013-03-22 Thread Wenchao Xia
to be implemented and portable, maybe it can be used as a simple improvement for migrate to fd, before an underlining mem snapshot API is available. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [RFC] qmp interface for save vmstate to image

2013-03-21 Thread Wenchao Xia
. My patch is actually introducing migrate vmstate to block instead of stream. In the qemu_savevm_state_complete we will save only non-live data. This should reduce the vmstate size and also speedup the saving of vmstate with minimal memory usage. Pavel On 03/15/2013 08:24 AM, Wenchao Xia

Re: [Qemu-devel] [RFC] qmp interface for save vmstate to image

2013-03-18 Thread Wenchao Xia
于 2013-3-15 22:51, Stefan Hajnoczi 写道: On Fri, Mar 15, 2013 at 03:24:38PM +0800, Wenchao Xia wrote: I'd like to add a new way to save vmstate, which will based on the migration thread, but will write contents to block images, instead of fd as stream. Following is the method to add API

Re: [Qemu-devel] [PATCH V2 07/10] snapshot: qmp use new internal API for external snapshot transaction

2013-03-18 Thread Wenchao Xia
于 2013-3-14 16:22, Kevin Wolf 写道: Am 14.03.2013 um 06:08 hat Wenchao Xia geschrieben: 于 2013-3-13 18:18, Kevin Wolf 写道: Am 12.03.2013 um 09:30 hat Wenchao Xia geschrieben: I redesigned the structure, Following is the fake code: typedef struct BdrvActionOps { /* check the request's

Re: [Qemu-devel] [PATCH V9 00/14] qmp/hmp interfaces for internal snapshot info

2013-03-18 Thread Wenchao Xia
于 2013-3-15 16:07, Kevin Wolf 写道: Am 15.03.2013 um 07:07 hat Wenchao Xia geschrieben: 于 2013-3-13 20:40, Stefan Hajnoczi 写道: The same applies for VMDK where one .vmdk can reference multiple extent files. I'd like to confirm: This means a block device can have multiple images at top level

Re: [Qemu-devel] [RFC] qmp interface for save vmstate to image

2013-03-18 Thread Wenchao Xia
于 2013-3-18 17:04, Kevin Wolf 写道: Am 18.03.2013 um 07:40 hat Wenchao Xia geschrieben: 于 2013-3-15 22:51, Stefan Hajnoczi 写道: On Fri, Mar 15, 2013 at 03:24:38PM +0800, Wenchao Xia wrote: I'd like to add a new way to save vmstate, which will based on the migration thread, but will write

Re: [Qemu-devel] [RFC] qmp interface for save vmstate to image

2013-03-18 Thread Wenchao Xia
span 10 sectors (5120 bytes). Paolo I think in streaming case, zero page will be handled well. I use qcow2 mainly for fseek() case, which may have some zero holes inside. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V9 00/14] qmp/hmp interfaces for internal snapshot info

2013-03-15 Thread Wenchao Xia
', 'iops_rd': 'int', 'iops_wr': 'int', 'images': ['ImageInfo']} }} -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V9 01/14] block: move bdrv_snapshot_find() to block/snapshot.c

2013-03-15 Thread Wenchao Xia
file? /* * QEMU System Emulator * * Copyright (c) 2003-2008 Fabrice Bellard . -- Best Regards Wenchao Xia

[Qemu-devel] [RFC] qmp interface for save vmstate to image

2013-03-15 Thread Wenchao Xia
options only for the image migration. 2 new command vmstate-save with above options. Then use query-migrate and migrate incoming to query/restore the states, which seems wild. I can't decide which is better, could u take a look and put some comments on this? -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH] block: drop bs_snapshots global variable

2013-03-15 Thread Wenchao Xia
This fix my problem in moving code to block/snapshot.c. Reviewed-by: Wenchao Xia xiaw...@linux.vnet.ibm.com -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V2 07/10] snapshot: qmp use new internal API for external snapshot transaction

2013-03-13 Thread Wenchao Xia
于 2013-3-13 18:18, Kevin Wolf 写道: Am 12.03.2013 um 09:30 hat Wenchao Xia geschrieben: I redesigned the structure, Following is the fake code: typedef struct BdrvActionOps { /* check the request's validation, allocate p_opaque if needed */ int (*check)(BlockdevAction *action, void

Re: [Qemu-devel] [PATCH V2 07/10] snapshot: qmp use new internal API for external snapshot transaction

2013-03-12 Thread Wenchao Xia
于 2013-1-15 15:03, Wenchao Xia 写道: 于 2013-1-14 18:06, Stefan Hajnoczi 写道: On Mon, Jan 14, 2013 at 10:56:30AM +0800, Wenchao Xia wrote: 于 2013-1-11 17:12, Stefan Hajnoczi 写道: On Fri, Jan 11, 2013 at 02:22:28PM +0800, Wenchao Xia wrote: 于 2013-1-10 20:41, Stefan Hajnoczi 写道: On Thu, Jan 10

Re: [Qemu-devel] [PATCH V2 07/10] snapshot: qmp use new internal API for external snapshot transaction

2013-03-12 Thread Wenchao Xia
于 2013-3-12 23:43, Stefan Hajnoczi 写道: On Tue, Mar 12, 2013 at 04:30:41PM +0800, Wenchao Xia wrote: 于 2013-1-15 15:03, Wenchao Xia 写道: 于 2013-1-14 18:06, Stefan Hajnoczi 写道: On Mon, Jan 14, 2013 at 10:56:30AM +0800, Wenchao Xia wrote: 于 2013-1-11 17:12, Stefan Hajnoczi 写道: On Fri, Jan 11

Re: [Qemu-devel] [PATCH V9 01/14] block: move bdrv_snapshot_find() to block/snapshot.c

2013-03-12 Thread Wenchao Xia
. Thanks for your comments, I am ignorant about licenses. Dual license seems good to me. Paolo, can I have your opinion on this? -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH V9 00/14] qmp/hmp interfaces for internal snapshot info

2013-03-12 Thread Wenchao Xia
于 2013-3-13 0:16, Eric Blake 写道: On 03/12/2013 04:07 AM, Stefan Hajnoczi wrote: On Mon, Mar 11, 2013 at 07:23:02PM +0800, Wenchao Xia wrote: In the use of snapshot a way to retrieve related info at runtime is needed, so this serial of patches will merge some code for qemu and qemu-img

[Qemu-devel] [PATCH V9 00/14] qmp/hmp interfaces for internal snapshot info

2013-03-11 Thread Wenchao Xia
. 9/14: Better documents. Wenchao Xia (14): 1 block: move bdrv_snapshot_find() to block/snapshot.c 2 block: distinguish id and name in bdrv_find_snapshot() 3 qemu-img: remove unused parameter in collect_image_info() 4 block: move collect_snapshots() and collect_image_info() to block/qapi.c

[Qemu-devel] [PATCH V9 01/14] block: move bdrv_snapshot_find() to block/snapshot.c

2013-03-11 Thread Wenchao Xia
This patch adds block/snapshot.c and then moves the function there. It also fixes small code style errors reported by check script. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/Makefile.objs |1 + block/snapshot.c | 37

[Qemu-devel] [PATCH V9 05/14] block: add snapshot info query function bdrv_query_snapshot_info_list()

2013-03-11 Thread Wenchao Xia
This patch adds function bdrv_query_snapshot_info_list(), which will retrieve snapshot info of an image in qmp object format. The implementation is based on the code moved from qemu-img.c with modification to fit more for qmp based block layer API. Signed-off-by: Wenchao Xia xiaw

[Qemu-devel] [PATCH V9 04/14] block: move collect_snapshots() and collect_image_info() to block/qapi.c

2013-03-11 Thread Wenchao Xia
This patch adds block/qapi.c and moves the functions there. To avoid conflict and tip better, macro in header file is BLOCK_QAPI_H instead of QAPI_H. The moving is for making review easier, those functions will be modified and renamed later. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com

[Qemu-devel] [PATCH V9 09/14] qmp: add interface query-images

2013-03-11 Thread Wenchao Xia
This mirror function will return image info including snapshots, and if specified backing image's info will also be returned. Now Qemu have both query-images and query-block interfaces. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c | 83

[Qemu-devel] [PATCH V9 03/14] qemu-img: remove unused parameter in collect_image_info()

2013-03-11 Thread Wenchao Xia
Parameter *fmt was not used, so remove it. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- qemu-img.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 471de7d..f4e5d90 100644

[Qemu-devel] [PATCH V9 07/14] block: add image info query function bdrv_query_image_info()

2013-03-11 Thread Wenchao Xia
This patch adds function bdrv_query_image_info(), which will retrieve image info in qmp object format. The implementation is based on the code moved from qemu-img.c, but uses block layer function to get snapshot info. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake

[Qemu-devel] [PATCH V9 11/14] hmp: switch snapshot info function to qmp based one

2013-03-11 Thread Wenchao Xia
This patch using new added function in last commit which retrieve info from qmp for snapshot info. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- monitor.c |2 +- savevm.c | 64 - 2 files changed, 1 insertions(+), 65

[Qemu-devel] [PATCH V9 10/14] hmp: add function hmp_info_snapshots()

2013-03-11 Thread Wenchao Xia
the qmp object got to strings in stdout or monitor console. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp.c | 42 ++ hmp.h |1 + 2 files changed, 43 insertions(+), 0 deletions(-) diff --git a/hmp.c b/hmp.c index 2f47a8a..34f0691 100644

[Qemu-devel] [PATCH V9 08/14] qmp: add interface query-snapshots

2013-03-11 Thread Wenchao Xia
This interface returns info of valid internal snapshots for whole vm. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c | 18 + qapi-schema.json | 14 + qmp-commands.hx | 55 ++ 3

[Qemu-devel] [PATCH V9 14/14] hmp: add command info images

2013-03-11 Thread Wenchao Xia
This command will show block image's information, including internal snapshots. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- hmp.c | 38 ++ hmp.h |1 + monitor.c |7 +++ 3 files changed, 46 insertions(+), 0 deletions

[Qemu-devel] [PATCH V9 12/14] block: move dump_human_image_info() to block/qapi.c

2013-03-11 Thread Wenchao Xia
This function is needed later in hmp command, it is also renamed to bdrv_image_info_dump(). Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c | 67 include/block/qapi.h |1 + qemu-img.c | 69

[Qemu-devel] [PATCH V9 06/14] block: add check for VM snapshot in bdrv_query_snapshot_info_list()

2013-03-11 Thread Wenchao Xia
This patch adds a parameter to tell whether return valid snapshots for whole VM only. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c | 42 -- include/block/qapi.h |1 + qemu-img.c |3 ++- 3 files

[Qemu-devel] [PATCH V9 02/14] block: distinguish id and name in bdrv_find_snapshot()

2013-03-11 Thread Wenchao Xia
. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/snapshot.c | 46 ++ include/block/snapshot.h |2 +- savevm.c | 10 +- 3 files changed, 44 insertions(+), 14

[Qemu-devel] [PATCH V9 13/14] block: dump to buffer for bdrv_image_info_dump()

2013-03-11 Thread Wenchao Xia
This allow hmp use this function, just like qemu-img. It also returns a pointer now to make it easy to use. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/qapi.c | 67 +++-- include/block/qapi.h |2 +- qemu-img.c

Re: [Qemu-devel] [PATCH V9 01/14] block: move bdrv_snapshot_find() to block/snapshot.c

2013-03-11 Thread Wenchao Xia
于 2013-3-12 1:49, Eric Blake 写道: On 03/11/2013 05:23 AM, Wenchao Xia wrote: This patch adds block/snapshot.c and then moves the function there. It also fixes small code style errors reported by check script. Signed-off-by: Wenchao Xia xiaw...@linux.vnet.ibm.com --- block/Makefile.objs

<    7   8   9   10   11   12   13   14   15   16   >