diff --git a/block/backup.c b/block/backup.c index 4a1af68c327d0497953f44dd37d4d4deeb723747..d3c7d9f85d68f6fa1fcedbc780332ae43de579f5 100644 --- a/block/backup.c +++ b/block/backup.c @@ -38,7 +38,7 @@ typedef struct CowRequest { typedef struct BackupBlockJob { BlockJob common; BlockDriverState *target; - /* bitmap for sync=dirty-bitmap */ + /* bitmap for sync=incremental */ BdrvDirtyBitmap *sync_bitmap; MirrorSyncMode sync_mode; RateLimit limit; @@ -365,7 +365,7 @@ static void coroutine_fn backup_run(void *opaque) qemu_coroutine_yield(); job->common.busy = true; } - } else if (job->sync_mode == MIRROR_SYNC_MODE_DIRTY_BITMAP) { + } else if (job->sync_mode == MIRROR_SYNC_MODE_INCREMENTAL) { ret = backup_run_incremental(job); } else { /* Both FULL and TOP SYNC_MODE's require copying.. */ @@ -497,10 +497,10 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target, return; } - if (sync_mode == MIRROR_SYNC_MODE_DIRTY_BITMAP) { + if (sync_mode == MIRROR_SYNC_MODE_INCREMENTAL) { if (!sync_bitmap) { error_setg(errp, "must provide a valid bitmap name for " - "\"dirty-bitmap\" sync mode"); + "\"incremental\" sync mode"); return; } @@ -535,7 +535,7 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target, job->on_target_error = on_target_error; job->target = target; job->sync_mode = sync_mode; - job->sync_bitmap = sync_mode == MIRROR_SYNC_MODE_DIRTY_BITMAP ? + job->sync_bitmap = sync_mode == MIRROR_SYNC_MODE_INCREMENTAL ? sync_bitmap : NULL; job->common.len = len; job->common.co = qemu_coroutine_create(backup_run); diff --git a/block/mirror.c b/block/mirror.c index 048e452d17c1570731410a23f468789241218a81..49aa8bc1b102ac90606df06d3d6a06dd32c173ca 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -710,8 +710,8 @@ void mirror_start(BlockDriverState *bs, BlockDriverState *target, bool is_none_mode; BlockDriverState *base; - if (mode == MIRROR_SYNC_MODE_DIRTY_BITMAP) { - error_setg(errp, "Sync mode 'dirty-bitmap' not supported"); + if (mode == MIRROR_SYNC_MODE_INCREMENTAL) { + error_setg(errp, "Sync mode 'incremental' not supported"); return; } is_none_mode = mode == MIRROR_SYNC_MODE_NONE; diff --git a/docs/bitmaps.md b/docs/bitmaps.md index f066b48aa511cfd7e878a225f162e7cf6e095788..fa87f077fe971f87337749dc9f21099a9912ca00 100644 --- a/docs/bitmaps.md +++ b/docs/bitmaps.md @@ -210,7 +210,7 @@ full backup as a backing image. "bitmap": "bitmap0", "target": "incremental.0.img", "format": "qcow2", - "sync": "dirty-bitmap", + "sync": "incremental", "mode": "existing" } } @@ -235,7 +235,7 @@ full backup as a backing image. "bitmap": "bitmap0", "target": "incremental.1.img", "format": "qcow2", - "sync": "dirty-bitmap", + "sync": "incremental", "mode": "existing" } } @@ -275,7 +275,7 @@ full backup as a backing image. "bitmap": "bitmap0", "target": "incremental.0.img", "format": "qcow2", - "sync": "dirty-bitmap", + "sync": "incremental", "mode": "existing" } } @@ -308,7 +308,7 @@ full backup as a backing image. "bitmap": "bitmap0", "target": "incremental.0.img", "format": "qcow2", - "sync": "dirty-bitmap", + "sync": "incremental", "mode": "existing" } } diff --git a/include/block/block_int.h b/include/block/block_int.h index b0476fc36ea10b008d09abdb0ce436dacfbcf762..44a5cf755780be6b1a667fb3052d807c51e30b75 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -635,7 +635,7 @@ void mirror_start(BlockDriverState *bs, BlockDriverState *target, * @target: Block device to write to. * @speed: The maximum speed, in bytes per second, or 0 for unlimited. * @sync_mode: What parts of the disk image should be copied to the destination. - * @sync_bitmap: The dirty bitmap if sync_mode is MIRROR_SYNC_MODE_DIRTY_BITMAP. + * @sync_bitmap: The dirty bitmap if sync_mode is MIRROR_SYNC_MODE_INCREMENTAL. * @on_source_error: The action to take upon error reading from the source. * @on_target_error: The action to take upon error writing to the target. * @cb: Completion function for the job. diff --git a/qapi/block-core.json b/qapi/block-core.json index 5a368f6e194c0438e16ae8f982fff483ebfc4bc2..ed3f8902e512f7235b010d57679a29b2ddcdb4e9 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -536,12 +536,12 @@ # # @none: only copy data written from now on # -# @dirty-bitmap: only copy data described by the dirty bitmap. Since: 2.4 +# @incremental: only copy data described by the dirty bitmap. Since: 2.4 # # Since: 1.3 ## { 'enum': 'MirrorSyncMode', - 'data': ['top', 'full', 'none', 'dirty-bitmap'] } + 'data': ['top', 'full', 'none', 'incremental'] } ## # @BlockJobType: @@ -724,8 +724,8 @@ # # @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 +# @bitmap: #optional the name of dirty bitmap if sync is "incremental". +# Must be present if sync is "incremental", must NOT be present # otherwise. (Since 2.4) # # @on-source-error: #optional the action to take on an error on the source, diff --git a/qmp-commands.hx b/qmp-commands.hx index a05d25ff60b9110374fc289711af385877ecad7d..87fa1722fb8fc55a6efb62871438069a57bfb248 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -1137,10 +1137,10 @@ Arguments: (json-string, optional) - "sync": what parts of the disk image should be copied to the destination; possibilities include "full" for all the disk, "top" for only the sectors - allocated in the topmost image, "dirty-bitmap" for only the dirty sectors in + allocated in the topmost image, "incremental" for only the dirty sectors in the bitmap, or "none" to only replicate new I/O (MirrorSyncMode). -- "bitmap": dirty bitmap name for sync==dirty-bitmap. Must be present if sync - is "dirty-bitmap", must NOT be present otherwise. +- "bitmap": dirty bitmap name for sync==incremental. Must be present if sync + is "incremental", must NOT be present otherwise. - "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) diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124 index 8abce2f86943d6b6cdfc47019b16d8dc1e595e6e..9ccd11809f6ef23e94729deb7bc8aaef2ae20ec1 100644 --- a/tests/qemu-iotests/124 +++ b/tests/qemu-iotests/124 @@ -187,7 +187,7 @@ class TestIncrementalBackup(iotests.QMPTestCase): target = self.prepare_backup(bitmap, parent) res = self.do_qmp_backup(device=bitmap.drive['id'], - sync='dirty-bitmap', bitmap=bitmap.name, + sync='incremental', bitmap=bitmap.name, format=bitmap.drive['fmt'], target=target, mode='existing') if not res: @@ -325,7 +325,7 @@ class TestIncrementalBackup(iotests.QMPTestCase): self.assert_no_active_block_jobs() self.files.append(self.err_img) result = self.vm.qmp('drive-backup', device=self.drives[0]['id'], - sync='dirty-bitmap', format=self.drives[0]['fmt'], + sync='incremental', format=self.drives[0]['fmt'], target=self.err_img) self.assert_qmp(result, 'error/class', 'GenericError') @@ -334,7 +334,7 @@ class TestIncrementalBackup(iotests.QMPTestCase): self.assert_no_active_block_jobs() self.files.append(self.err_img) result = self.vm.qmp('drive-backup', device=self.drives[0]['id'], - sync='dirty-bitmap', bitmap='unknown', + sync='incremental', bitmap='unknown', format=self.drives[0]['fmt'], target=self.err_img) self.assert_qmp(result, 'error/class', 'GenericError')