From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFhGO-0005eU-6J for qemu-devel@nongnu.org; Wed, 22 Jun 2016 08:28:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFhGJ-0002pd-QK for qemu-devel@nongnu.org; Wed, 22 Jun 2016 08:28:11 -0400 Received: from mail-am1on0130.outbound.protection.outlook.com ([157.56.112.130]:19176 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFhGJ-0002pZ-Co for qemu-devel@nongnu.org; Wed, 22 Jun 2016 08:28:07 -0400 References: <1464686130-12265-1-git-send-email-den@openvz.org> <1464686130-12265-4-git-send-email-den@openvz.org> <575F143A.9010406@redhat.com> From: Pavel Butsykin Message-ID: <576A844E.8010100@virtuozzo.com> Date: Wed, 22 Jun 2016 15:27:58 +0300 MIME-Version: 1.0 In-Reply-To: <575F143A.9010406@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 03/11] qcow2: add qcow2_co_write_compressed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , "Denis V. Lunev" , qemu-devel@nongnu.org Cc: Jeff Cody , Markus Armbruster , John Snow , Stefan Hajnoczi , Kevin Wolf On 13.06.2016 23:14, Eric Blake wrote: > On 05/31/2016 03:15 AM, Denis V. Lunev wrote: >> From: Pavel Butsykin >> >> Added implementation of the qcow2_co_write_compressed function that >> will allow us to safely use compressed writes for the qcow2 from running VMs. >> >> Signed-off-by: Pavel Butsykin >> 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/qcow2.c | 89 ++++++++++++++++++++++++++++++++++------------------------- >> 1 file changed, 52 insertions(+), 37 deletions(-) >> >> diff --git a/block/qcow2.c b/block/qcow2.c >> index c9306a7..38caa66 100644 >> --- a/block/qcow2.c >> +++ b/block/qcow2.c >> @@ -2535,13 +2535,16 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset) >> >> /* XXX: put compressed sectors first, then all the cluster aligned >> tables to avoid losing bytes in alignment */ >> -static int qcow2_write_compressed(BlockDriverState *bs, int64_t sector_num, >> - const uint8_t *buf, int nb_sectors) >> +static coroutine_fn int >> +qcow2_co_write_compressed(BlockDriverState *bs, int64_t sector_num, >> + int nb_sectors, QEMUIOVector *qiov) > > Is it worth converting to a byte-based qcow2_co_pwrite_compressed() > while at it? > Yes, I'll do it for the next version.