qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/11] qcow2: add qcow2_co_write_compressed


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 03/11] qcow2: add qcow2_co_write_compressed
Date: Tue, 28 Jun 2016 13:17:38 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 22.06.2016 um 14:27 hat Pavel Butsykin geschrieben:
> On 13.06.2016 23:14, Eric Blake wrote:
> >On 05/31/2016 03:15 AM, Denis V. Lunev wrote:
> >>From: Pavel Butsykin <address@hidden>
> >>
> >>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 <address@hidden>
> >>Signed-off-by: Denis V. Lunev <address@hidden>
> >>CC: Jeff Cody <address@hidden>
> >>CC: Markus Armbruster <address@hidden>
> >>CC: Eric Blake <address@hidden>
> >>CC: John Snow <address@hidden>
> >>CC: Stefan Hajnoczi <address@hidden>
> >>CC: Kevin Wolf <address@hidden>
> >>---
> >>  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.

I think it makes sense to do this in two steps. That is, one patch for
making the function vectored and a second one for making it byte-based.
Of course, you can take bytes as a unit even in the first patch, but
then just convert it to sector numbers immediately, so that the actual
conversion comes separately.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]