On 04.07.19 15:09, Denis Plotnikov wrote: > The patch allow to process image compression type defined > in the image header and choose an appropriate method for > image clusters (de)compression. > > Signed-off-by: Denis Plotnikov > --- > block/qcow2.c | 93 ++++++++++++++++++++++++++++++++++++++++----------- > 1 file changed, 73 insertions(+), 20 deletions(-) > > diff --git a/block/qcow2.c b/block/qcow2.c > index 8fa932a349..a107f76e98 100644 > --- a/block/qcow2.c > +++ b/block/qcow2.c [...] > @@ -4153,20 +4156,67 @@ qcow2_co_do_compress(BlockDriverState *bs, void *dest, size_t dest_size, > return arg.ret; > } > > +/* > + * qcow2_co_compress() > + * > + * Compress @src_size bytes of data using the compression > + * method defined by the image compression type > + * > + * @dest - destination buffer, @dest_size bytes > + * @src - source buffer, @src_size bytes > + * > + * Returns: 0 on success Actually, it returns the number of compressed bytes. Max > + * a negative error code on fail > + */