The idea is simple - backup is "written-once" data. It is written block by block and it is large enough. It would be nice to save storage space and compress it.
These patches add the ability to compress data during backup. This functionality is implemented by means of adding options to the qmp/hmp commands(drive-backup, blockdev-backup). The implementation is quite simple, because the responsibility for data compression imposed on the format driver. Signed-off-by: Pavel Butsykin <pbutsy...@virtuozzo.com> Signed-off-by: Denis V. Lunev <d...@openvz.org> CC: Jeff Cody <jc...@redhat.com> CC: Markus Armbruster <arm...@redhat.com> CC: Eric Blake <ebl...@redhat.com> CC: John Snow <js...@redhat.com> CC: Stefan Hajnoczi <stefa...@redhat.com> CC: Kevin Wolf <kw...@redhat.com> Pavel Butsykin (10): block/io: add bdrv_co_write_compressed qcow2: add qcow2_co_write_compressed vmdk: add vmdk_co_write_compressed qcow: add qcow_co_write_compressed block: remove BlockDriver.bdrv_write_compressed drive-backup: added support for data compression blockdev-backup: added support for data compression qemu-iotests: test backup compression in 055 block: fix backup in vmdk format image qemu-iotests: add vmdk for test backup compression in 055 block/backup.c | 13 +++++ block/io.c | 57 ++++++++++++++++++-- block/qcow.c | 78 ++++++++++++++++------------ block/qcow2.c | 89 ++++++++++++++++++------------- block/vmdk.c | 61 ++++------------------ blockdev.c | 20 ++++++- hmp-commands.hx | 8 +-- hmp.c | 3 +- include/block/block.h | 2 + include/block/block_int.h | 5 +- qapi/block-core.json | 3 +- qemu-img.c | 2 +- qmp-commands.hx | 7 ++- tests/qemu-iotests/055 | 118 ++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/055.out | 4 +- tests/qemu-iotests/iotests.py | 10 ++-- 16 files changed, 336 insertions(+), 144 deletions(-) -- Changes from v1: - added unittest for backup compression (8) Changes from v2: - implemented a new .bdrv_co_write_compressed interface to replace the old .bdrv_write_compressed (1,2,3,4,5) 2.1.4