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

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

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

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

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

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

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

2013-06-14 Thread Wenchao Xia
probably follow the same pattern, so allow .commit() to be NULL. Suggested-by: Eric Blake Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Wenchao Xia Signed-off-by: Wenchao Xia --- blockdev.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git

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

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

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

2013-06-14 Thread Wenchao Xia
drop an empty line between bdrv_open() and checking its return value. This may be due to copy-pasting from earlier code that performed other operations before handling errors. Reported-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Wenchao Xia Signed-off-by

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

2013-06-14 Thread Wenchao Xia
12: better error message. 08/12: better document and spell fix. 10/12, 11/12: rename the command and related function to snapshot_blkdev_internal. Stefan Hajnoczi (3): 1 blockdev: drop redundant proto_drv check 2 blockdev: rename BlkTransactionStates to singular 3 blockdev: allow BdrvActio

Re: [Qemu-devel] [PATCH v5 03/11] block: add basic backup support to block driver

2013-06-13 Thread Wenchao Xia
于 2013-6-13 14:33, Fam Zheng 写道: On Thu, 06/13 14:07, Wenchao Xia wrote: 于 2013-6-13 14:03, Wenchao Xia 写道: 于 2013-6-7 15:18, Stefan Hajnoczi 写道: On Thu, Jun 06, 2013 at 04:56:49PM +0800, Fam Zheng wrote: On Thu, 06/06 10:05, Stefan Hajnoczi wrote: On Thu, Jun 06, 2013 at 11:56:18AM +0800

Re: [Qemu-devel] [PATCH v5 03/11] block: add basic backup support to block driver

2013-06-12 Thread Wenchao Xia
于 2013-6-13 14:03, Wenchao Xia 写道: 于 2013-6-7 15:18, Stefan Hajnoczi 写道: On Thu, Jun 06, 2013 at 04:56:49PM +0800, Fam Zheng wrote: On Thu, 06/06 10:05, Stefan Hajnoczi wrote: On Thu, Jun 06, 2013 at 11:56:18AM +0800, Fam Zheng wrote: On Thu, 05/30 14:34, Stefan Hajnoczi wrote: + +static

Re: [Qemu-devel] [PATCH v5 03/11] block: add basic backup support to block driver

2013-06-12 Thread Wenchao Xia
hink adding that in qemu emulator helps much, and it will make things more complicit user won't care who is doing the job, qemu or qemu-img. -- Best Regards Wenchao Xia

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

2013-06-12 Thread Wenchao Xia
于 2013-6-11 17:25, Stefan Hajnoczi 写道: On Sat, Jun 08, 2013 at 02:58:02PM +0800, Wenchao Xia wrote: static int find_snapshot_by_id_or_name(BlockDriverState *bs, const char *name) I suggest renaming the argument to make it less confusing: const char *name_or_id will rename it

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

2013-06-12 Thread Wenchao Xia
于 2013-6-11 17:14, Stefan Hajnoczi 写道: On Sat, Jun 08, 2013 at 02:58:01PM +0800, Wenchao Xia wrote: +/* + * Every internal snapshot have an ID used by qemu block layer, this function + * check whether name used by user mess up with ID. An empty string is also + * invalid. + */ +bool

Re: [Qemu-devel] [PATCH 04/11] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-06-12 Thread Wenchao Xia
于 2013-6-11 16:26, Stefan Hajnoczi 写道: On Sat, Jun 08, 2013 at 02:58:00PM +0800, Wenchao Xia wrote: +if (id && name) { +for (i = 0; i < nb_sns; i++) { +sn = &sn_tab[i]; +if (!strcmp(sn->id_str, id) && !strcmp(sn->name, name)) { +

Re: [Qemu-devel] [PATCHv2 2/2] migration: do not overwrite zero pages

2013-06-12 Thread Wenchao Xia
memset. If incoming page is zero, then if on destination it is not zero, memset. Logic is OK. Only question is if the read operation in is_zero_page() consumes memory, as there are doubt in the discuss before. Any way this patch will not break migration in my opinion. Reviewed-by: Wenchao Xia

Re: [Qemu-devel] [PATCHv2 1/2] Revert "migration: do not sent zero pages in bulk stage"

2013-06-12 Thread Wenchao Xia
clear patch, I don't see any issue. Reviewed-by: Wenchao Xia > Not sending zero pages breaks migration if a page is zero > at the source but not at the destination. This can e.g. happen > if different BIOS versions are used at source and destination. > It has also been report

Re: [Qemu-devel] [Qemu-ppc] broken incoming migration

2013-06-12 Thread Wenchao Xia
#x27;s copy-on-write, not copy-on-read :) we can just check for pages that are zero and not rewrite them with zeros. That's I think it is the right way to improve overcommit without breaking anything. what Peter's patches do, I'll review them right away. Paolo -- Best Regards Wenchao Xia

Re: [Qemu-devel] broken incoming migration

2013-06-08 Thread Wenchao Xia
于 2013-6-9 11:09, Alexey Kardashevskiy 写道: On 06/09/2013 01:01 PM, Wenchao Xia wrote: 于 2013-6-9 10:34, Alexey Kardashevskiy 写道: On 06/09/2013 12:16 PM, Wenchao Xia wrote: 于 2013-6-8 16:30, Alexey Kardashevskiy 写道: On 06/08/2013 06:27 PM, Wenchao Xia wrote: On 04.06.2013 16:40, Paolo

Re: [Qemu-devel] broken incoming migration

2013-06-08 Thread Wenchao Xia
于 2013-6-9 10:34, Alexey Kardashevskiy 写道: On 06/09/2013 12:16 PM, Wenchao Xia wrote: 于 2013-6-8 16:30, Alexey Kardashevskiy 写道: On 06/08/2013 06:27 PM, Wenchao Xia wrote: On 04.06.2013 16:40, Paolo Bonzini wrote: Il 04/06/2013 16:38, Peter Lieven ha scritto: On 04.06.2013 16:14, Paolo

Re: [Qemu-devel] [PATCH 10/11] hmp: add interface hmp_snapshot_internal_blkdev

2013-06-08 Thread Wenchao Xia
于 2013-6-8 16:21, Fam Zheng 写道: On Sat, 06/08 14:58, Wenchao Xia wrote: Signed-off-by: Wenchao Xia --- hmp-commands.hx | 24 ++-- hmp.c | 10 ++ hmp.h |1 + 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/hmp

Re: [Qemu-devel] [PATCH 04/11] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-06-08 Thread Wenchao Xia
于 2013-6-8 16:35, Fam Zheng 写道: On Sat, 06/08 15:58, Wenchao Xia wrote: 于 2013-6-8 15:31, Fam Zheng 写道: On Sat, 06/08 14:58, Wenchao Xia wrote: To make it clear about id and name in searching, add this API to distinguish them. Caller can choose to search by id or name, *errp will be set only

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

2013-06-08 Thread Wenchao Xia
于 2013-6-8 16:05, Fam Zheng 写道: On Sat, 06/08 14:58, Wenchao Xia wrote: This interface can generate snapshot name automatically if it is not specified, since it is a single opertion. Snapshot ID can't be specified in this interface. Signed-off-by: Wenchao Xia --- blockdev.c |

Re: [Qemu-devel] broken incoming migration

2013-06-08 Thread Wenchao Xia
于 2013-6-8 16:30, Alexey Kardashevskiy 写道: On 06/08/2013 06:27 PM, Wenchao Xia wrote: On 04.06.2013 16:40, Paolo Bonzini wrote: Il 04/06/2013 16:38, Peter Lieven ha scritto: On 04.06.2013 16:14, Paolo Bonzini wrote: Il 04/06/2013 15:52, Peter Lieven ha scritto: On 30.05.2013 16:41, Paolo

Re: [Qemu-devel] broken incoming migration

2013-06-08 Thread Wenchao Xia
rusage( RUSAGE_SELF, &rusage ); printf("read offset: %d kB, RSS size: %ld kB", ((i+1) << 10), rusage.ru_maxrss); getchar(); } printf("%d zero pages\n", ret); } -- Best Regards Wenchao Xia

Re: [Qemu-devel] broken incoming migration

2013-06-08 Thread Wenchao Xia
s not available immediately. You could also scan the page for nonzero values before writing it. Paolo -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH 04/11] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-06-08 Thread Wenchao Xia
于 2013-6-8 15:31, Fam Zheng 写道: On Sat, 06/08 14:58, Wenchao Xia wrote: To make it clear about id and name in searching, add this API to distinguish them. Caller can choose to search by id or name, *errp will be set only for exception. Some code are modified based on Pavel's patch. Signe

[Qemu-devel] [PATCH 02/11] blockdev: rename BlkTransactionStates to singular

2013-06-08 Thread Wenchao Xia
nfusing to call the single structure "States". This patch renames it to "State", just like BlockDriverState is singular. Signed-off-by: Stefan Hajnoczi Reviewed-by: Wenchao Xia --- blockdev.c | 104 ++-- 1 files

[Qemu-devel] [PATCH 10/11] hmp: add interface hmp_snapshot_internal_blkdev

2013-06-08 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- hmp-commands.hx | 24 ++-- hmp.c | 10 ++ hmp.h |1 + 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 396691a..65fb94d 100644 --- a/hmp-commands.hx +++ b

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

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

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

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

[Qemu-devel] [PATCH 11/11] hmp: add interface hmp_snapshot_delete_internal_blkdev

2013-06-08 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- hmp-commands.hx | 19 +++ hmp.c | 10 ++ hmp.h |1 + 3 files changed, 30 insertions(+), 0 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 65fb94d..9d9229c 100644 --- a/hmp-commands.hx +++ b/hmp

[Qemu-devel] [PATCH 04/11] snapshot: new function bdrv_snapshot_find_by_id_and_name()

2013-06-08 Thread Wenchao Xia
To make it clear about id and name in searching, add this API to distinguish them. Caller can choose to search by id or name, *errp will be set only for exception. Some code are modified based on Pavel's patch. Signed-off-by: Wenchao Xia Signed-off-by: Pavel Hrdina --- block/snaps

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

2013-06-08 Thread Wenchao Xia
probably follow the same pattern, so allow .commit() to be NULL. Suggested-by: Eric Blake Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Wenchao Xia --- blockdev.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c inde

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

2013-06-08 Thread Wenchao Xia
ed in this interface. Signed-off-by: Wenchao Xia --- blockdev.c | 118 ++ qapi-schema.json | 16 +++ qmp-commands.hx | 32 +++--- 3 files changed, 159 insertions(+), 7 deletions(-) diff --git a/blockdev.c b/blockdev.c

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

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

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

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

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

2013-06-08 Thread Wenchao Xia
_drv check 2 blockdev: rename BlkTransactionStates to singular 3 blockdev: allow BdrvActionOps->commit() to be NULL Wenchao Xia (8): 4 snapshot: new function bdrv_snapshot_find_by_id_and_name() 5 snapshot: add paired functions for internal snapshot id and name 6 snapshot: distinguish id a

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

2013-06-08 Thread Wenchao Xia
drop an empty line between bdrv_open() and checking its return value. This may be due to copy-pasting from earlier code that performed other operations before handling errors. Reported-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Wenchao Xia

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

2013-06-07 Thread Wenchao Xia
I insist to remove compile warning since I want gcc check my code with strict rule. Wenchao Xia writes: This patch simply remove "variable may be used uninitialized" warning. Signed-off-by: Wenchao Xia --- V2: Address Stefan and Peter's comments, use 0 in send_msg() instea

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

2013-06-07 Thread Wenchao Xia
This patch simply remove "variable may be used uninitialized" warning. Signed-off-by: Wenchao Xia --- V2: Address Stefan and Peter's comments, use 0 in send_msg() instead of initialize mhHeader. libcacard/vscclient.c |3 +-- util/iov.c|2 +- 2 files change

Re: [Qemu-devel] [PATCH V15 0/5] enhancement for qmp/hmp interfaces of block info

2013-06-06 Thread Wenchao Xia
于 2013-6-6 14:42, Fam Zheng 写道: On Thu, 06/06 12:27, Wenchao Xia wrote: This series lets qmp interface show delaied info, including internal snapshot Typo? s/delaied/detailed/ yep, it should be detailed, mistype. /backing chain on all block device at runtime, which helps management

Re: [Qemu-devel] [PATCH v5 00/11] block: drive-backup live backup command

2013-06-05 Thread Wenchao Xia
42 +- > include/qemu/notify.h | 25 > qapi-schema.json | 97 - > qmp-commands.hx| 46 ++ > tests/qemu-iotests/055 | 256 ++++++++++++ > tests/qemu-iotests/055.out | 5 + > tests/qemu-iotests/group | 1 + > util/notify.c | 30 > 12 files changed, 1088 insertions(+), 81 deletions(-) > create mode 100644 block/backup.c > create mode 100755 tests/qemu-iotests/055 > create mode 100644 tests/qemu-iotests/055.out > Reviewed patch 4, 7, 8 and they seems good, will use them in my following work. -- Best Regards Wenchao Xia

Re: [Qemu-devel] [PATCH v5 04/11] blockdev: drop redundant proto_drv check

2013-06-05 Thread Wenchao Xia
NULL, flags | BDRV_O_NO_BACKING, > drv); > - > if (ret < 0) { > bdrv_delete(target_bs); > error_set(errp, QERR_OPEN_FILE_FAILED, target); > Although it is not merged yet, I'll use it as pre-patches in my series which add internal snapshot support in qmp_transaction. Reviewed-by: Wenchao Xia -- Best Regards Wenchao Xia

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

2013-06-05 Thread Wenchao Xia
With these parameters, user can choose the information to be showed, to avoid message flood in the monitor. Signed-off-by: Wenchao Xia --- hmp.c | 25 - monitor.c |7 --- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/hmp.c b/hmp.c index

[Qemu-devel] [PATCH V15 3/5] qmp: add ImageInfo in BlockDeviceInfo used by query-block

2013-06-05 Thread Wenchao Xia
: Wenchao Xia --- block/qapi.c | 50 ++-- include/block/qapi.h |4 ++- qapi-schema.json | 10 ++- qmp-commands.hx | 69 - 4 files changed, 125 insertions(+), 8 deletions(-) diff --git a

[Qemu-devel] [PATCH V15 1/5] block: add snapshot info query function bdrv_query_snapshot_info_list()

2013-06-05 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 Reviewed-by: Eric

[Qemu-devel] [PATCH V15 2/5] block: add image info query function bdrv_query_image_info()

2013-06-05 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 --- block/qapi.c | 43

[Qemu-devel] [PATCH V15 0/5] enhancement for qmp/hmp interfaces of block info

2013-06-05 Thread Wenchao Xia
rule that use qmp to retrieve information, hmp layer just does a translation from qmp object it got. To make code graceful, snapshot and image info retrieving code in qemu and qemu-img are merged into block layer, and some function names were adjusted to describe them better. For the part touched

[Qemu-devel] [PATCH V15 4/5] hmp: show ImageInfo in 'info block'

2013-06-05 Thread Wenchao Xia
Now human monitor can show image details, include internal snapshot and backing chain info for every block device. Signed-off-by: Wenchao Xia --- hmp.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/hmp.c b/hmp.c index 4fb76ec..2aa832c 100644 --- a/hmp.c

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

2013-06-05 Thread Wenchao Xia
This patch simply remove "variable may be used uninitialized" warning. Signed-off-by: Wenchao Xia --- libcacard/vscclient.c |2 +- util/iov.c|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c ind

Re: [Qemu-devel] [PATCH V14 0/6] enhancement for qmp/hmp interfaces of block info

2013-06-05 Thread Wenchao Xia
于 2013-6-3 11:14, Wenchao Xia 写道: >This series lets qmp interface show delaied info, including internal > snapshot > /backing chain on all block device at runtime, which helps management stack > and > human user, by retrieving exactly the same info of what qemu see

[Qemu-devel] [PATCH V14 4/6] qmp: add ImageInfo in BlockDeviceInfo used by query-block

2013-06-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 --- block/qapi.c | 43

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

2013-06-02 Thread Wenchao Xia
With these parameters, user can choose the information to be showed, to avoid message flood in the monitor. Signed-off-by: Wenchao Xia Reviewed-by: Kevin Wolf --- hmp.c | 25 - monitor.c |7 --- 2 files changed, 20 insertions(+), 12 deletions(-) diff

[Qemu-devel] [PATCH V14 2/6] block: add image info query function bdrv_query_image_info()

2013-06-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 --- block/qapi.c | 43

[Qemu-devel] [PATCH V14 5/6] hmp: show ImageInfo in 'info block'

2013-06-02 Thread Wenchao Xia
Now human monitor can show image details, include internal snapshot and backing chain info for every block device. Signed-off-by: Wenchao Xia --- hmp.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/hmp.c b/hmp.c index 4fb76ec..2aa832c 100644 --- a/hmp.c

[Qemu-devel] [PATCH V14 1/6] block: add snapshot info query function bdrv_query_snapshot_info_list()

2013-06-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 Reviewed-by: Eric

[Qemu-devel] [PATCH V14 3/6] qmp: add recursive member in ImageInfo

2013-06-02 Thread Wenchao Xia
New member *backing-image is added to reflect the backing chain status. Signed-off-by: Wenchao Xia --- block/qapi.c |7 +++ qapi-schema.json |5 - 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index e9d8b74..a407c3d 100644 --- a

[Qemu-devel] [PATCH V14 0/6] enhancement for qmp/hmp interfaces of block info

2013-06-02 Thread Wenchao Xia
rule that use qmp to retrieve information, hmp layer just does a translation from qmp object it got. To make code graceful, snapshot and image info retrieving code in qemu and qemu-img are merged into block layer, and some function names were adjusted to describe them better. For the par

Re: [Qemu-devel] [PATCH V3 0/4] qapi and snapshot code clean up in block layer

2013-06-02 Thread Wenchao Xia
于 2013-5-31 21:19, Luiz Capitulino 写道: On Fri, 31 May 2013 21:04:10 +0800 Wenchao Xia wrote: 于 2013-5-30 10:41, Wenchao Xia 写道: 于 2013-5-27 23:41, Kevin Wolf 写道: Am 25.05.2013 um 05:09 hat Wenchao Xia geschrieben: These patches are the common part of my hmp/qmp block query series and

Re: [Qemu-devel] [PATCH V3 0/4] qapi and snapshot code clean up in block layer

2013-05-31 Thread Wenchao Xia
于 2013-5-30 10:41, Wenchao Xia 写道: 于 2013-5-27 23:41, Kevin Wolf 写道: Am 25.05.2013 um 05:09 hat Wenchao Xia geschrieben: These patches are the common part of my hmp/qmp block query series and Pavel's qmp snapshot command converion series. It mainly does following things: 1 move sna

Re: [Qemu-devel] [PATCH V3 0/4] qapi and snapshot code clean up in block layer

2013-05-29 Thread Wenchao Xia
于 2013-5-27 23:41, Kevin Wolf 写道: Am 25.05.2013 um 05:09 hat Wenchao Xia geschrieben: These patches are the common part of my hmp/qmp block query series and Pavel's qmp snapshot command converion series. It mainly does following things: 1 move snapshot related code to block/snapshot.c, qm

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

2013-05-29 Thread Wenchao Xia
于 2013-5-29 23:10, Badari Pulavarty 写道: > On 05/29/2013 02:05 AM, Wenchao Xia wrote: >> 于 2013-5-28 17:00, Wenchao Xia 写道: >>> 于 2013-5-28 16:33, Asias He 写道: >>>> On Tue, May 28, 2013 at 10:01:14AM +0200, Paolo Bonzini wrote: >>>>> Il 28/05/2013

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

2013-05-29 Thread Wenchao Xia
于 2013-5-29 17:09, Stefan Hajnoczi 写道: On Wed, May 29, 2013 at 03:54:46PM +0800, Wenchao Xia wrote: 于 2013-5-28 15:46, Stefan Hajnoczi 写道: On Mon, May 27, 2013 at 05:25:16PM +0200, Kevin Wolf wrote: Am 25.05.2013 um 05:09 hat Wenchao Xia geschrieben: From: Stefan Hajnoczi The bs_snapshots

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

2013-05-29 Thread Wenchao Xia
于 2013-5-28 17:00, Wenchao Xia 写道: 于 2013-5-28 16:33, Asias He 写道: On Tue, May 28, 2013 at 10:01:14AM +0200, Paolo Bonzini wrote: Il 28/05/2013 09:13, Wenchao Xia ha scritto: From: Nicholas Bellinger The WWPN specified in configfs is passed to "-device vhost-scsi-pci". The tgpt fi

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

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

Re: [Qemu-devel] [SeaBIOS] SeaBIOS v1.7.2.2 stable release

2013-05-28 Thread Wenchao Xia
于 2013-5-29 12:43, Wenchao Xia 写道: 于 2013-5-29 8:08, Kevin O'Connor 写道: On Mon, May 27, 2013 at 05:11:46PM +0400, Michael Tokarev wrote: 27.05.2013 16:59, Kevin O'Connor wrote: A new stable release of SeaBIOS (version 1.7.2.2) has been tagged. This release contains bug fixes. The

Re: [Qemu-devel] [SeaBIOS] SeaBIOS v1.7.2.2 stable release

2013-05-28 Thread Wenchao Xia
upplied the parameter -bios to replace bios.bin in qemu command line, did I miss something? -- Best Regards Wenchao Xia

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

2013-05-28 Thread Wenchao Xia
于 2013-5-28 16:33, Asias He 写道: On Tue, May 28, 2013 at 10:01:14AM +0200, Paolo Bonzini wrote: Il 28/05/2013 09:13, Wenchao Xia ha scritto: From: Nicholas Bellinger The WWPN specified in configfs is passed to "-device vhost-scsi-pci". The tgpt field of the SET_ENDPOINT ioctl is ob

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

2013-05-28 Thread Wenchao Xia
COPYING.LIB file in the top-level directory. > + * > + */ > + > +#ifndef VHOST_SCSI_H > +#define VHOST_SCSI_H > + > +#include "qemu-common.h" > +#include "hw/qdev.h" > +#include "hw/virtio/virtio-scsi.h" > +#include "hw/virtio/vhost.h" > + > +/* > + * Used by QEMU userspace to ensure a consistent vhost-scsi ABI. > + * > + * ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate + > + *RFC-v2 vhost-scsi userspace. Add GET_ABI_VERSION ioctl usage > + * ABI Rev 1: January 2013. Ignore vhost_tpgt filed in struct > vhost_scsi_target. > + * All the targets under vhost_wwpn can be seen and used by guest. > + */ > + > +#define VHOST_SCSI_ABI_VERSION 1 > + > +/* TODO #include properly */ > +/* For VHOST_SCSI_SET_ENDPOINT/VHOST_SCSI_CLEAR_ENDPOINT ioctl */ > +struct vhost_scsi_target { > +int abi_version; > +char vhost_wwpn[224]; > +unsigned short vhost_tpgt; > +unsigned short reserved; > +}; > + > +enum vhost_scsi_vq_list { > +VHOST_SCSI_VQ_CONTROL = 0, > +VHOST_SCSI_VQ_EVENT = 1, > +VHOST_SCSI_VQ_NUM_FIXED = 2, > +}; > + > +#define VHOST_VIRTIO 0xAF > +#define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct > vhost_scsi_target) > +#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct > vhost_scsi_target) > +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, int) > + > +#define TYPE_VHOST_SCSI "vhost-scsi" > +#define VHOST_SCSI(obj) \ > +OBJECT_CHECK(VHostSCSI, (obj), TYPE_VHOST_SCSI) > + > +typedef struct VHostSCSI { > +VirtIOSCSICommon parent_obj; > + > +Error *migration_blocker; > + > +struct vhost_dev dev; > +} VHostSCSI; > + > +#define DEFINE_VHOST_SCSI_PROPERTIES(_state, _conf_field) \ > +DEFINE_PROP_STRING("vhostfd", _state, _conf_field.vhostfd), \ > +DEFINE_PROP_STRING("wwpn", _state, _conf_field.wwpn), \ > +DEFINE_PROP_UINT32("num_queues", _state, _conf_field.num_queues, 1), \ > +DEFINE_PROP_UINT32("max_sectors", _state, _conf_field.max_sectors, > 0x), \ > +DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128) > + > + > +#endif > diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h > index 4a961b9..4db346b 100644 > --- a/include/hw/virtio/virtio-scsi.h > +++ b/include/hw/virtio/virtio-scsi.h > @@ -151,6 +151,8 @@ struct VirtIOSCSIConf { > uint32_t num_queues; > uint32_t max_sectors; > uint32_t cmd_per_lun; > +char *vhostfd; > +char *wwpn; > }; > > typedef struct VirtIOSCSICommon { > -- Best Regards Wenchao Xia

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

2013-05-27 Thread Wenchao Xia
于 2013-5-27 23:25, Kevin Wolf 写道: Am 25.05.2013 um 05:09 hat Wenchao Xia geschrieben: From: Stefan Hajnoczi The bs_snapshots global variable points to the BlockDriverState which will be used to save vmstate. This is really a savevm.c concept but was moved into block.c:bdrv_snapshots() when

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

2013-05-27 Thread Wenchao Xia
于 2013-5-27 23:18, Kevin Wolf 写道: Am 25.05.2013 um 05:09 hat Wenchao Xia geschrieben: From: Stefan Hajnoczi The bs_snapshots global variable points to the BlockDriverState which will be used to save vmstate. This is really a savevm.c concept but was moved into block.c:bdrv_snapshots() when

Re: [Qemu-devel] [PATCH V3 4/4] block: dump snapshot and image info to specified output

2013-05-27 Thread Wenchao Xia
于 2013-5-27 23:40, Kevin Wolf 写道: Am 27.05.2013 um 17:02 hat Luiz Capitulino geschrieben: On Sat, 25 May 2013 11:09:45 +0800 Wenchao Xia wrote: bdrv_snapshot_dump() and bdrv_image_info_dump() do not dump to a buffer now, some internal buffers are still used for format control, which have no

Re: [Qemu-devel] [PATCH V13 3/6] qmp: add recursive member in ImageInfo

2013-05-26 Thread Wenchao Xia
于 2013-5-26 0:10, Eric Blake 写道: On 05/24/2013 10:24 PM, Wenchao Xia wrote: New member *backing-image is added to reflect the backing chain status. Signed-off-by: Wenchao Xia --- block/qapi.c | 16 +++- qapi-schema.json |5 - 2 files changed, 19 insertions(+), 2

[Qemu-devel] [PATCH V13 5/6] hmp: show ImageInfo in 'info block'

2013-05-24 Thread Wenchao Xia
Now human monitor can show image details, include internal snapshot and backing chain info for every block device. Signed-off-by: Wenchao Xia --- hmp.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/hmp.c b/hmp.c index 4fb76ec..2aa832c 100644 --- a/hmp.c

[Qemu-devel] [PATCH V13 3/6] qmp: add recursive member in ImageInfo

2013-05-24 Thread Wenchao Xia
New member *backing-image is added to reflect the backing chain status. Signed-off-by: Wenchao Xia --- block/qapi.c | 16 +++- qapi-schema.json |5 - 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index 680ec23..cbef584

[Qemu-devel] [PATCH V13 4/6] qmp: add ImageInfo in BlockDeviceInfo used by query-block

2013-05-24 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 --- block/qapi.c | 43

[Qemu-devel] [PATCH V13 2/6] block: add image info query function bdrv_query_image_info()

2013-05-24 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 --- block/qapi.c | 36

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

2013-05-24 Thread Wenchao Xia
With these parameters, user can choose the information to be showed, to avoid message flood in the monitor. Signed-off-by: Wenchao Xia Reviewed-by: Kevin Wolf --- hmp.c | 25 - monitor.c |7 --- 2 files changed, 20 insertions(+), 12 deletions(-) diff

[Qemu-devel] [PATCH V13 1/6] block: add snapshot info query function bdrv_query_snapshot_info_list()

2013-05-24 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 Reviewed-by: Eric

[Qemu-devel] [PATCH V13 0/6] enhancement for qmp/hmp interfaces of block info

2013-05-24 Thread Wenchao Xia
erial, it works as: qemu qemu-img dump_monitordump_stdout |--| | block/qapi.c Special thanks for Markus, Stefan, Kevin, Eric reviewing many times. v13: Renamed the serial as "enhancement for qmp/hmp interfaces of block info".

[Qemu-devel] [PATCH V3 4/4] block: dump snapshot and image info to specified output

2013-05-24 Thread Wenchao Xia
parameter specified. Signed-off-by: Wenchao Xia --- block/qapi.c | 66 +++-- include/block/qapi.h |6 +++- qemu-img.c |9 --- savevm.c |7 +++-- 4 files changed, 49 insertions(+), 39 deletions(-) diff

[Qemu-devel] [PATCH V3 2/4] block: move snapshot code in block.c to block/snapshot.c

2013-05-24 Thread Wenchao Xia
-off-by: Wenchao Xia --- block.c | 100 - block/Makefile.objs |1 + block/snapshot.c | 157 ++ include/block/block.h| 26 ++-- include/block/snapshot.h | 53

[Qemu-devel] [PATCH V3 3/4] block: move qmp and info dump related code to block/qapi.c

2013-05-24 Thread Wenchao Xia
e level in include path, block_int.h and qapi.h will both include them. Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- block.c | 185 --- block/Makefile.objs |2 +- block/qapi.c | 360

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

2013-05-24 Thread Wenchao Xia
ed to the bdrv_states list. This means that calling the new find_vmstate_bs() function is idempotent - it returns the same BlockDriverState unless it was hot-unplugged. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Wenchao Xia Signed-off-by: Wenchao Xia --- bl

[Qemu-devel] [PATCH V3 0/4] qapi and snapshot code clean up in block layer

2013-05-24 Thread Wenchao Xia
t, instead of use global variable "cur_mon" inside. v3: Address Stefan's comments: 2/4: do not move bdrv_is_snapshot(). 4/4: reuse fprintf_function function pointer instead of a new function. Stefan Hajnoczi (1): 1 block: drop bs_snapshots global variable Wenchao Xia (3):

Re: [Qemu-devel] [PATCH V2 5/5] block: dump to specified output for bdrv_snapshot_dump() and bdrv_image_info_dump()

2013-05-23 Thread Wenchao Xia
于 2013-5-24 9:48, Wenchao Xia 写道: 于 2013-5-23 23:31, Eric Blake 写道: On 05/23/2013 02:47 AM, Wenchao Xia wrote: Buffer is not used now so the string would not be truncated any more. They can be used by both qemu and qemu-img with correct parameter specified. Signed-off-by: Wenchao Xia

Re: [Qemu-devel] [PATCH V2 5/5] block: dump to specified output for bdrv_snapshot_dump() and bdrv_image_info_dump()

2013-05-23 Thread Wenchao Xia
于 2013-5-23 23:31, Eric Blake 写道: On 05/23/2013 02:47 AM, Wenchao Xia wrote: Buffer is not used now so the string would not be truncated any more. They can be used by both qemu and qemu-img with correct parameter specified. Signed-off-by: Wenchao Xia --- block/qapi.c | 65

Re: [Qemu-devel] [PATCH V2 4/5] util: add new function message_printf()

2013-05-23 Thread Wenchao Xia
于 2013-5-23 23:05, Eric Blake 写道: On 05/23/2013 02:47 AM, Wenchao Xia wrote: This function takes an input parameter *output, which can be specified by caller as stderr, stdout or a monitor. error_vprintf() now calls message_vprintf(), which is a static function added in this patch. Signed-off

[Qemu-devel] [PATCH V2 2/5] block: move snapshot code in block.c to block/snapshot.c

2013-05-23 Thread Wenchao Xia
All snapshot related code, except bdrv_snapshot_dump(), is moved to block/snapshot.c. bdrv_snapshot_dump() will be moved to another file later. It also fixes small code style errors reported by check script. Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- block.c | 105

[Qemu-devel] [PATCH V2 1/5] block: drop bs_snapshots global variable

2013-05-23 Thread Wenchao Xia
ed to the bdrv_states list. This means that calling the new find_vmstate_bs() function is idempotent - it returns the same BlockDriverState unless it was hot-unplugged. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: Wenchao Xia Signed-off-by: Wenchao Xia --- bl

[Qemu-devel] [PATCH V2 5/5] block: dump to specified output for bdrv_snapshot_dump() and bdrv_image_info_dump()

2013-05-23 Thread Wenchao Xia
Buffer is not used now so the string would not be truncated any more. They can be used by both qemu and qemu-img with correct parameter specified. Signed-off-by: Wenchao Xia --- block/qapi.c | 65 +++--- include/block/qapi.h |5

[Qemu-devel] [PATCH V2 4/5] util: add new function message_printf()

2013-05-23 Thread Wenchao Xia
This function takes an input parameter *output, which can be specified by caller as stderr, stdout or a monitor. error_vprintf() now calls message_vprintf(), which is a static function added in this patch. Signed-off-by: Wenchao Xia --- include/qemu/error-report.h | 13 + util

[Qemu-devel] [PATCH V2 3/5] block: move qmp and info dump related code to block/qapi.c

2013-05-23 Thread Wenchao Xia
array 'bdrv_states'. 4 code style fix. To avoid conflict and tip better, macro in header file is BLOCK_QAPI_H instead of QAPI_H. Now block.h and snapshot.h are at the same level in include path, block_int.h and qapi.h will both include them. Signed-off-by: Wenchao Xia Reviewed-by:

[Qemu-devel] [PATCH V2 0/5] qapi and snapshot code clean up in block layer

2013-05-23 Thread Wenchao Xia
7;s serial. Use a parameter in message_printf() to tell where to print, instead of use global variable "cur_mon" inside. Wenchao Xia (4): 2 block: move snapshot code in block.c to block/snapshot.c 3 block: move qmp and info dump related code to block/qapi.c 4 util: add new function

Re: [Qemu-devel] [PATCH 7/7] block: dump to monitor for bdrv_snapshot_dump() and bdrv_image_info_dump()

2013-05-21 Thread Wenchao Xia
于 2013-5-20 10:39, Wenchao Xia 写道: > 于 2013-5-17 20:30, Luiz Capitulino 写道: >> On Fri, 17 May 2013 11:30:31 +0800 >> Wenchao Xia wrote: >> >>> 于 2013-5-16 20:17, Luiz Capitulino 写道: >>>> On Thu, 16 May 2013 10:22:09 +0800 >>>> Wenchao Xia w

Re: [Qemu-devel] [PATCH v3 0/8] block: drive-backup live backup command

2013-05-20 Thread Wenchao Xia
于 2013-5-17 17:14, Stefan Hajnoczi 写道: On Fri, May 17, 2013 at 02:58:57PM +0800, Wenchao Xia wrote: 于 2013-5-16 15:47, Stefan Hajnoczi 写道: On Thu, May 16, 2013 at 02:16:20PM +0800, Wenchao Xia wrote: After checking the code, I found it possible to add delta data backup support also, If an

Re: [Qemu-devel] [PATCH 7/7] block: dump to monitor for bdrv_snapshot_dump() and bdrv_image_info_dump()

2013-05-19 Thread Wenchao Xia
于 2013-5-17 20:30, Luiz Capitulino 写道: On Fri, 17 May 2013 11:30:31 +0800 Wenchao Xia wrote: 于 2013-5-16 20:17, Luiz Capitulino 写道: On Thu, 16 May 2013 10:22:09 +0800 Wenchao Xia wrote: 于 2013-5-15 20:28, Luiz Capitulino 写道: On Wed, 15 May 2013 10:10:37 +0800 Wenchao Xia wrote: 于 2013

Re: [Qemu-devel] [PATCH V2 2/2] qcow2: cancel the modification on fail in qcow2_snapshot_create()

2013-05-19 Thread Wenchao Xia
于 2013-5-17 17:27, Stefan Hajnoczi 写道: On Fri, May 17, 2013 at 03:56:45PM +0800, Wenchao Xia wrote: Signed-off-by: Wenchao Xia --- block/qcow2-snapshot.c | 17 ++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c

[Qemu-devel] [PATCH V2 2/2] qcow2: cancel the modification on fail in qcow2_snapshot_create()

2013-05-17 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- block/qcow2-snapshot.c | 17 ++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 45da32d..033f705 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c @@ -367,7 +367,7

[Qemu-devel] [PATCH V2 1/2] qcow2: free allocated cluster on fail in qcow2_write_snapshots()

2013-05-17 Thread Wenchao Xia
Signed-off-by: Wenchao Xia --- block/qcow2-snapshot.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 992a5c8..45da32d 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c @@ -180,13 +180,13

[Qemu-devel] [PATCH V2 0/2] qcow2: try cancel the modification on fail in snapshot creation

2013-05-17 Thread Wenchao Xia
V2: 1/2: all fail case will goto fail section. 2/2: add the goto code. Wenchao Xia (2): 1 qcow2: free allocated cluster on fail in qcow2_write_snapshots() 2 qcow2: cancel the modification on fail in qcow2_snapshot_create() block/qcow2-snapshot.c | 27 --- 1

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