From d58d84539784d27c826924a79d9436178b07ff69 Mon Sep 17 00:00:00 2001 From: John Snow Date: Fri, 17 Apr 2015 19:49:58 -0400 Subject: qmp: Add support of "dirty-bitmap" sync mode for drive-backup For "dirty-bitmap" sync mode, the block job will iterate through the given dirty bitmap to decide if a sector needs backup (backup all the dirty clusters and skip clean ones), just as allocation conditions of "top" sync mode. Signed-off-by: Fam Zheng Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Message-id: 1429314609-29776-11-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- qapi/block-core.json | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'qapi/block-core.json') diff --git a/qapi/block-core.json b/qapi/block-core.json index f3b92d80c9..8a4c7f21fc 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -512,10 +512,12 @@ # # @none: only copy data written from now on # +# @dirty-bitmap: only copy data described by the dirty bitmap. Since: 2.4 +# # Since: 1.3 ## { 'enum': 'MirrorSyncMode', - 'data': ['top', 'full', 'none'] } + 'data': ['top', 'full', 'none', 'dirty-bitmap'] } ## # @BlockJobType: @@ -690,14 +692,18 @@ # probe if @mode is 'existing', else the format of the source # # @sync: what parts of the disk image should be copied to the destination -# (all the disk, only the sectors allocated in the topmost image, or -# only new I/O). +# (all the disk, only the sectors allocated in the topmost image, from a +# dirty bitmap, or only new I/O). # # @mode: #optional whether and how QEMU should create a new image, default is # 'absolute-paths'. # # @speed: #optional the maximum speed, in bytes per second # +# @bitmap: #optional the name of dirty bitmap if sync is "dirty-bitmap". +# Must be present if sync is "dirty-bitmap", must NOT be present +# otherwise. (Since 2.4) +# # @on-source-error: #optional 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 (see BlockInfo). @@ -715,7 +721,7 @@ { 'type': 'DriveBackup', 'data': { 'device': 'str', 'target': 'str', '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', - '*speed': 'int', + '*speed': 'int', '*bitmap': 'str', '*on-source-error': 'BlockdevOnError', '*on-target-error': 'BlockdevOnError' } } -- cgit v1.2.3