On 05/14/2016 06:45 AM, Denis V. Lunev wrote: > From: Pavel Butsykin <[email protected]> > > 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. > > The patch adds a flag to the qmp/hmp drive-backup command which enables > block compression. Compression should be implemented in the format driver > to enable this feature. > > There are some limitations of the format driver to allow compressed writes. > We can write data only once. Though for backup this is perfectly fine. > These limitations are maintained by the driver and the error will be > reported if we are doing something wrong. >
> +++ b/qapi/block-core.json
> @@ -905,7 +905,7 @@
> { 'struct': 'DriveBackup',
> 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
> 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
> - '*speed': 'int', '*bitmap': 'str',
> + '*speed': 'int', '*bitmap': 'str', '*compress': 'bool',
Missing documentation of the new option.
> '*on-source-error': 'BlockdevOnError',
> '*on-target-error': 'BlockdevOnError' } }
>
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index 94847e5..8915a0b 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -1186,7 +1186,8 @@ EQMP
> {
> .name = "drive-backup",
> .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
> - "bitmap:s?,on-source-error:s?,on-target-error:s?",
> + "bitmap:s?,compress:b?,"
> + "on-source-error:s?,on-target-error:s?",
> .mhandler.cmd_new = qmp_marshal_drive_backup,
> },
>
> @@ -1220,6 +1221,7 @@ Arguments:
> - "mode": whether and how QEMU should create a new image
> (NewImageMode, optional, default 'absolute-paths')
> - "speed": the maximum speed, in bytes per second (json-int, optional)
> +- "compress": compress data blocks (if the target format supports it).
Missing mention that it is optional, default false.
> - "on-source-error": the action to take on an error on the source, default
> 'report'. 'stop' and 'enospc' can only be used
> if the block device supports io-status.
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
