From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQJpf-0002Le-NN for qemu-devel@nongnu.org; Thu, 21 Jul 2016 15:40:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQJpa-00011u-0z for qemu-devel@nongnu.org; Thu, 21 Jul 2016 15:40:30 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:25580 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQJpZ-0000zf-Ji for qemu-devel@nongnu.org; Thu, 21 Jul 2016 15:40:25 -0400 From: "Denis V. Lunev" Date: Thu, 21 Jul 2016 22:40:13 +0300 Message-Id: <1469130019-18497-11-git-send-email-den@openvz.org> In-Reply-To: <1469130019-18497-1-git-send-email-den@openvz.org> References: <1469130019-18497-1-git-send-email-den@openvz.org> Subject: [Qemu-devel] [PATCH v6 10/16] block/io: turn on dirty_bitmaps for the compressed writes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: den@openvz.org, Pavel Butsykin , Jeff Cody , Markus Armbruster , Eric Blake , John Snow , Stefan Hajnoczi , Kevin Wolf From: Pavel Butsykin Previously was added the assert: commit 1755da16e32c15b22a521e8a38539e4b5cf367f3 Author: Paolo Bonzini Date: Thu Oct 18 16:49:18 2012 +0200 block: introduce new dirty bitmap functionality Now the compressed write is always in coroutine and setting the bits is done after the write, so that we can return the dirty_bitmaps for the compressed writes. Signed-off-by: Pavel Butsykin Reviewed-by: Stefan Hajnoczi Signed-off-by: Denis V. Lunev CC: Jeff Cody CC: Markus Armbruster CC: Eric Blake CC: John Snow CC: Stefan Hajnoczi CC: Kevin Wolf --- block/io.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/block/io.c b/block/io.c index 60922ed..bc9eee5 100644 --- a/block/io.c +++ b/block/io.c @@ -896,7 +896,6 @@ bdrv_driver_pwritev_compressed(BlockDriverState *bs, uint64_t offset, return -ENOTSUP; } - assert(QLIST_EMPTY(&bs->dirty_bitmaps)); return drv->bdrv_co_pwritev_compressed(bs, offset, bytes, qiov); } @@ -1317,6 +1316,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BlockDriverState *bs, } else if (flags & BDRV_REQ_ZERO_WRITE) { bdrv_debug_event(bs, BLKDBG_PWRITEV_ZERO); ret = bdrv_co_do_pwrite_zeroes(bs, offset, bytes, flags); + } else if (flags & BDRV_REQ_WRITE_COMPRESSED) { + ret = bdrv_driver_pwritev_compressed(bs, offset, bytes, qiov); } else if (bytes <= max_transfer) { bdrv_debug_event(bs, BLKDBG_PWRITEV); ret = bdrv_driver_pwritev(bs, offset, bytes, qiov, flags); @@ -1568,14 +1569,9 @@ int coroutine_fn bdrv_co_pwritev(BdrvChild *child, bytes = ROUND_UP(bytes, align); } - if (flags & BDRV_REQ_WRITE_COMPRESSED) { - ret = bdrv_driver_pwritev_compressed( - bs, offset, bytes, use_local_qiov ? &local_qiov : qiov); - } else { - ret = bdrv_aligned_pwritev(bs, &req, offset, bytes, align, - use_local_qiov ? &local_qiov : qiov, - flags); - } + ret = bdrv_aligned_pwritev(bs, &req, offset, bytes, align, + use_local_qiov ? &local_qiov : qiov, + flags); fail: -- 2.5.0