From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG0jM-0000r7-Mv for qemu-devel@nongnu.org; Thu, 23 Jun 2016 05:15:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG0jI-0003tO-DX for qemu-devel@nongnu.org; Thu, 23 Jun 2016 05:15:23 -0400 Received: from mail-am1on0134.outbound.protection.outlook.com ([157.56.112.134]:32283 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG0jH-0003sz-EV for qemu-devel@nongnu.org; Thu, 23 Jun 2016 05:15:20 -0400 References: <1464686130-12265-1-git-send-email-den@openvz.org> <1464686130-12265-9-git-send-email-den@openvz.org> <575F151E.6080608@redhat.com> From: Pavel Butsykin Message-ID: <576BA89E.3020501@virtuozzo.com> Date: Thu, 23 Jun 2016 12:15:10 +0300 MIME-Version: 1.0 In-Reply-To: <575F151E.6080608@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/11] drive-backup: added support for data compression List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , "Denis V. Lunev" , qemu-devel@nongnu.org Cc: Jeff Cody , Markus Armbruster , John Snow , Stefan Hajnoczi , Kevin Wolf On 13.06.2016 23:18, Eric Blake wrote: > On 05/31/2016 03:15 AM, Denis V. Lunev wrote: >> From: Pavel Butsykin >> >> 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. >> > >> @@ -3309,6 +3315,7 @@ void qmp_drive_backup(const char *device, const char *target, >> bool has_mode, enum NewImageMode mode, >> bool has_speed, int64_t speed, >> bool has_bitmap, const char *bitmap, >> + bool has_compress, bool compress, >> bool has_on_source_error, BlockdevOnError on_source_error, >> bool has_on_target_error, BlockdevOnError on_target_error, >> Error **errp) > > Might be nice to simplify this signature once my qapi 'box' patches land. > Yes, it would certainly be better. But your patches are not applied on the current, maybe you have your own branch? > >> +++ b/qapi/block-core.json >> @@ -888,6 +888,9 @@ >> # Must be present if sync is "incremental", must NOT be present >> # otherwise. (Since 2.4) >> # >> +# @compress: #optional the compression data blocks (if the target format >> +# supports it; default: false). > > Missing a '(since 2.7)' notation. > >> +++ 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,8 @@ 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": the compression data blocks (if the target format supports it). >> + (json-bool, optional, default false) > > Reads awkwardly; maybe "compress": true to compress data, if the target > format supports it. (json-bool, optional, default false) > >