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? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org