[Qemu-block] [PATCH 0/4] block: Mirror discarded sectors

2015-05-05 Thread Fam Zheng
This fixes the mirror assert failure reported by wangxiaolong: https://lists.gnu.org/archive/html/qemu-devel/2015-04/msg04458.html The direct cause is that hbitmap code couldn't handle unset of bits *after* iterator's current position. We could fix that, but the bdrv_reset_dirty() call is more

[Qemu-block] [PATCH 2/4] block: Remove bdrv_reset_dirty

2015-05-05 Thread Fam Zheng
Using this function woule always be wrong because a dirty bitmap must have a specific owner that consumes the dirty bits and calls bdrv_reset_dirty_bitmap(). Remove the unused function to avoid future misuse. Signed-off-by: Fam Zheng f...@redhat.com --- block.c | 12

[Qemu-block] [PATCH 4/4] qemu-iotests: Add test case for mirror with unmap

2015-05-05 Thread Fam Zheng
This checks that the discard on mirror source that effectively zeroes data is also reflected by the data of target. Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/131 | 59 ++ tests/qemu-iotests/131.out | 5

Re: [Qemu-block] [Qemu-devel] [PATCH 1/6] qcow2: use one single memory block for the L2/refcount cache tables

2015-05-05 Thread Alberto Garcia
On Thu 30 Apr 2015 05:08:05 PM CEST, Eric Blake ebl...@redhat.com wrote: typedef struct Qcow2CachedTable { -void* table; int64_t offset; booldirty; int cache_hits; @@ -40,39 +39,34 @@ struct Qcow2Cache { struct Qcow2Cache* depends; int

Re: [Qemu-block] [Qemu-devel] [PATCH 2/6] qcow2: simplify qcow2_cache_put() and qcow2_cache_entry_mark_dirty()

2015-05-05 Thread Alberto Garcia
On Fri 01 May 2015 04:31:52 PM CEST, Stefan Hajnoczi wrote: int qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table) { -int i; +int i = (*table - c-table_array) / c-table_size; -for (i = 0; i c-size; i++) { -if (table_addr(c, i) == *table) { -

Re: [Qemu-block] [PATCH COLO v3 01/14] docs: block replication's description

2015-05-05 Thread Fam Zheng
On Wed, 05/06 02:26, Dong, Eddie wrote: -Original Message- From: Dr. David Alan Gilbert [mailto:dgilb...@redhat.com] Sent: Tuesday, May 05, 2015 11:24 PM To: Stefan Hajnoczi Cc: Paolo Bonzini; Wen Congyang; Fam Zheng; Kevin Wolf; Lai Jiangshan; qemu block; Jiang, Yunhong;

Re: [Qemu-block] [PATCH COLO v3 01/14] docs: block replication's description

2015-05-05 Thread Dong, Eddie
-Original Message- From: Dr. David Alan Gilbert [mailto:dgilb...@redhat.com] Sent: Tuesday, May 05, 2015 11:24 PM To: Stefan Hajnoczi Cc: Paolo Bonzini; Wen Congyang; Fam Zheng; Kevin Wolf; Lai Jiangshan; qemu block; Jiang, Yunhong; Dong, Eddie; qemu devel; Max Reitz; Gonglei; Yang

Re: [Qemu-block] [PATCH 3/4] qemu-iotests: Make block job methods common

2015-05-05 Thread Fam Zheng
On Tue, 05/05 18:17, John Snow wrote: On 05/05/2015 08:46 AM, Fam Zheng wrote: Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/041| 66 ++- tests/qemu-iotests/iotests.py | 28 ++ 2 files changed, 43

[Qemu-block] [PATCH v2 0/6] block: Mirror discarded sectors

2015-05-05 Thread Fam Zheng
v2: Fix typo and add Eric's rev-by in patch 3. Add patch 1 to discard target in mirror job. (Paolo) Add patch 6 to improve iotests.wait_ready. (John) This fixes the mirror assert failure reported by wangxiaolong: https://lists.gnu.org/archive/html/qemu-devel/2015-04/msg04458.html The

[Qemu-block] [PATCH v2 1/6] mirror: Discard target sectors if not allocated at source side

2015-05-05 Thread Fam Zheng
If guest discards a source cluster during mirror, we would want to discard target side as well. Signed-off-by: Fam Zheng f...@redhat.com --- block/mirror.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 58f391a..37a5b61

[Qemu-block] [PATCH v2 2/6] block: Fix dirty bitmap in bdrv_co_discard

2015-05-05 Thread Fam Zheng
Unsetting dirty globally with discard is not very correct. The discard may zero out sectors (depending on can_write_zeroes_with_unmap), we should replicate this change to destinition side to make sure that the guest sees the same data. Calling bdrv_reset_dirty also troubles mirror job because the

[Qemu-block] [PATCH v2 6/6] iotests: Use event_wait in wait_ready

2015-05-05 Thread Fam Zheng
Only poll the specific type of event we are interested in, to avoid stealing events that should be consumed by someone else. Suggested-by: John Snow js...@redhat.com Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/iotests.py | 9 ++--- 1 file changed, 2 insertions(+), 7

[Qemu-block] [PATCH v2 4/6] qemu-iotests: Make block job methods common

2015-05-05 Thread Fam Zheng
Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/041| 66 ++- tests/qemu-iotests/iotests.py | 28 ++ 2 files changed, 43 insertions(+), 51 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041

[Qemu-block] [PATCH v2 5/6] qemu-iotests: Add test case for mirror with unmap

2015-05-05 Thread Fam Zheng
This checks that the discard on mirror source that effectively zeroes data is also reflected by the data of target. Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/131 | 59 ++ tests/qemu-iotests/131.out | 5

Re: [Qemu-block] [PATCH 1/6] qcow2: use one single memory block for the L2/refcount cache tables

2015-05-05 Thread Alberto Garcia
On Tue 05 May 2015 01:20:19 PM CEST, Kevin Wolf wrote: Though looking at the code again I see now that c-table_size isn't consistently used. The I/O requests still use s-cluster_size. We should either use it everywhere or not introduce it at all. c-table_size is necessary in order to

Re: [Qemu-block] [Qemu-devel] [PATCH 2/6] qcow2: simplify qcow2_cache_put() and qcow2_cache_entry_mark_dirty()

2015-05-05 Thread Eric Blake
On 04/30/2015 04:11 AM, Alberto Garcia wrote: Since all tables are now stored together, it is possible to obtain the position of a particular table directly from its address, so the operation becomes O(1). Signed-off-by: Alberto Garcia be...@igalia.com --- block/qcow2-cache.c | 22

Re: [Qemu-block] [PATCH COLO v3 01/14] docs: block replication's description

2015-05-05 Thread Dr. David Alan Gilbert
* Stefan Hajnoczi (stefa...@redhat.com) wrote: On Fri, Apr 24, 2015 at 11:36:35AM +0200, Paolo Bonzini wrote: On 24/04/2015 11:38, Wen Congyang wrote: That can be done with drive-mirror. But I think it's too early for that. Do you mean use drive-mirror instead of quorum?

Re: [Qemu-block] [Qemu-devel] [PATCH v3 0/9] ahci: enable migration

2015-05-05 Thread John Snow
On 04/30/2015 02:07 PM, John Snow wrote: The day we all feared is here, and I am proposing we allow the migration of the AHCI device tentatively for the 2.4 development window. There are some more NCQ migration tests are needed, but I felt that it was important to get migration enabled as

Re: [Qemu-block] [Qemu-devel] [PATCH v3 3/9] libqos: Add migration helpers

2015-05-05 Thread John Snow
On 05/05/2015 07:35 AM, Kevin Wolf wrote: Am 04.05.2015 um 19:52 hat John Snow geschrieben: On 05/04/2015 08:07 AM, Kevin Wolf wrote: Am 30.04.2015 um 20:07 hat John Snow geschrieben: +/* Otherwise, we need to wait: poll until migration is completed. */ +while (1) { +rsp =

Re: [Qemu-block] [Qemu-devel] [RFC] Differential Backups

2015-05-05 Thread John Snow
On 05/05/2015 06:25 AM, Stefan Hajnoczi wrote: On Wed, Apr 29, 2015 at 06:51:08PM -0400, John Snow wrote: This is a feature that should be very easy to add on top of the existing incremental feature, since it's just a difference in how the bitmap is treated: Incremental - Links to the last

[Qemu-block] [PATCH] vmdk: Fix overflow if l1_size is 0x20000000

2015-05-05 Thread Fam Zheng
Richard Jones caught this bug with afl fuzzer. In fact, that's the only possible value to overflow (extent-l1_size = 0x2000) l1_size: l1_size = extent-l1_size * sizeof(long) = 0x8000; g_try_malloc returns NULL because l1_size is interpreted as negative during type casting from 'int' to

Re: [Qemu-block] [PATCH] vmdk: Fix overflow if l1_size is 0x20000000

2015-05-05 Thread Richard W.M. Jones
On Tue, May 05, 2015 at 05:28:13PM +0800, Fam Zheng wrote: Richard Jones caught this bug with afl fuzzer. In fact, that's the only possible value to overflow (extent-l1_size = 0x2000) l1_size: l1_size = extent-l1_size * sizeof(long) = 0x8000; g_try_malloc returns NULL because

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/3] block: Warn about usage of growing formats over non-growable protocols

2015-05-05 Thread Stefan Hajnoczi
On Thu, Mar 19, 2015 at 03:03:18PM -0400, Max Reitz wrote: Some image formats (e.g. qcow2) require the underlying file to grow on write accesses, but this is in fact not supported by all protocols (e.g. nbd does not). If such a format requiring file growth is used non-read-only over a protocol

Re: [Qemu-block] [PATCH 1/6] qcow2: use one single memory block for the L2/refcount cache tables

2015-05-05 Thread Kevin Wolf
Am 05.05.2015 um 12:28 hat Stefan Hajnoczi geschrieben: On Mon, May 04, 2015 at 12:58:13PM +0200, Kevin Wolf wrote: Am 01.05.2015 um 16:23 hat Stefan Hajnoczi geschrieben: On Thu, Apr 30, 2015 at 01:11:40PM +0300, Alberto Garcia wrote: Qcow2Cache *qcow2_cache_create(BlockDriverState