From nobody Wed May 1 19:05:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600766867; cv=none; d=zohomail.com; s=zohoarc; b=KUvMVAUIfHulzvQMcW4ToiA0Lrb3iT0560l6cA4di59T5WJCnqUhBQDc1u6uQQaqPGzD2Qz6u+Yc9zFHIB6P8nY8dXhgO4g3/ED0ykFIfCBhIPgPDKJEZVp1/EeerzOOOnrItuM8tUiiFoStr5uCrrN2bQ8S1N4I1YNnY9dHVkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600766867; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cS97bTEaKa3h8BwJqnu4rKqCNxALsmDQWemt9d3M6No=; b=RNhTbux6MPKw1I0nc0iaUKaUFaYHyoMiPDv5BAeDWVTalSP4Q9bXGphTiHsxmZr6oAJujgpG9i+ojDnH+ZPjZnIpnlu4bHjXCJgvCyZDVJX/FC/5E56yl2W38J3c1z1kDeVKYiz/etdNTSIM442MtvvbNkUPIKGsE1QtrQNLqR4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600766867928194.728888791739; Tue, 22 Sep 2020 02:27:47 -0700 (PDT) Received: from localhost ([::1]:57626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKeaQ-0000Eg-Hl for importer@patchew.org; Tue, 22 Sep 2020 05:27:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKeW1-0002FZ-LW; Tue, 22 Sep 2020 05:23:13 -0400 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:32658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKeVx-0005cZ-4x; Tue, 22 Sep 2020 05:23:13 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 60C37454AC; Tue, 22 Sep 2020 11:14:30 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: qemu-devel@nongnu.org Subject: [PATCH qemu 1/4] drive-mirror: add support for sync=bitmap mode=never Date: Tue, 22 Sep 2020 11:14:15 +0200 Message-Id: <20200922091418.53562-2-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200922091418.53562-1-f.gruenbichler@proxmox.com> References: <20200922091418.53562-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.186.127.180; envelope-from=f.gruenbichler@proxmox.com; helo=proxmox-new.maurer-it.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 05:14:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Ma Haocong , Markus Armbruster , Max Reitz , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: John Snow This patch adds support for the "BITMAP" sync mode to drive-mirror and blockdev-mirror. It adds support only for the BitmapSyncMode "never," because it's the simplest mode. This mode simply uses a user-provided bitmap as an initial copy manifest, and then does not clear any bits in the bitmap at the conclusion of the operation. Any new writes dirtied during the operation are copied out, in contrast to backup. Note that whether these writes are reflected in the bitmap at the conclusion of the operation depends on whether that bitmap is actually recording! This patch was originally based on one by Ma Haocong, but it has since been modified pretty heavily. Suggested-by: Ma Haocong Signed-off-by: Ma Haocong Signed-off-by: John Snow Signed-off-by: Fabian Gr=C3=BCnbichler Reviewed-by: Max Reitz --- include/block/block_int.h | 4 +- block/mirror.c | 98 ++++++++++++++++++++++++++++++------- blockdev.c | 39 +++++++++++++-- tests/test-block-iothread.c | 4 +- qapi/block-core.json | 29 +++++++++-- 5 files changed, 145 insertions(+), 29 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 38cad9d15c..8b7cec67ad 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -1230,7 +1230,9 @@ void mirror_start(const char *job_id, BlockDriverStat= e *bs, BlockDriverState *target, const char *replaces, int creation_flags, int64_t speed, uint32_t granularity, int64_t buf_size, - MirrorSyncMode mode, BlockMirrorBackingMode backing_mode, + MirrorSyncMode mode, BdrvDirtyBitmap *bitmap, + BitmapSyncMode bitmap_mode, + BlockMirrorBackingMode backing_mode, bool zero_target, BlockdevOnError on_source_error, BlockdevOnError on_target_error, diff --git a/block/mirror.c b/block/mirror.c index 26acf4af6f..d64c8203ef 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -50,7 +50,7 @@ typedef struct MirrorBlockJob { BlockDriverState *to_replace; /* Used to block operations on the drive-mirror-replace target */ Error *replace_blocker; - bool is_none_mode; + MirrorSyncMode sync_mode; BlockMirrorBackingMode backing_mode; /* Whether the target image requires explicit zero-initialization */ bool zero_target; @@ -65,6 +65,8 @@ typedef struct MirrorBlockJob { size_t buf_size; int64_t bdev_length; unsigned long *cow_bitmap; + BdrvDirtyBitmap *sync_bitmap; + BitmapSyncMode bitmap_mode; BdrvDirtyBitmap *dirty_bitmap; BdrvDirtyBitmapIter *dbi; uint8_t *buf; @@ -677,7 +679,8 @@ static int mirror_exit_common(Job *job) bdrv_child_refresh_perms(mirror_top_bs, mirror_top_bs->backing, &error_abort); if (!abort && s->backing_mode =3D=3D MIRROR_SOURCE_BACKING_CHAIN) { - BlockDriverState *backing =3D s->is_none_mode ? src : s->base; + BlockDriverState *backing; + backing =3D s->sync_mode =3D=3D MIRROR_SYNC_MODE_NONE ? src : s->b= ase; BlockDriverState *unfiltered_target =3D bdrv_skip_filters(target_b= s); =20 if (bdrv_cow_bs(unfiltered_target) !=3D backing) { @@ -774,6 +777,16 @@ static void mirror_abort(Job *job) assert(ret =3D=3D 0); } =20 +/* Always called after commit/abort. */ +static void mirror_clean(Job *job) +{ + MirrorBlockJob *s =3D container_of(job, MirrorBlockJob, common.job); + + if (s->sync_bitmap) { + bdrv_dirty_bitmap_set_busy(s->sync_bitmap, false); + } +} + static void coroutine_fn mirror_throttle(MirrorBlockJob *s) { int64_t now =3D qemu_clock_get_ns(QEMU_CLOCK_REALTIME); @@ -955,7 +968,8 @@ static int coroutine_fn mirror_run(Job *job, Error **er= rp) mirror_free_init(s); =20 s->last_pause_ns =3D qemu_clock_get_ns(QEMU_CLOCK_REALTIME); - if (!s->is_none_mode) { + if ((s->sync_mode =3D=3D MIRROR_SYNC_MODE_TOP) || + (s->sync_mode =3D=3D MIRROR_SYNC_MODE_FULL)) { ret =3D mirror_dirty_init(s); if (ret < 0 || job_is_cancelled(&s->common.job)) { goto immediate_exit; @@ -1188,6 +1202,7 @@ static const BlockJobDriver mirror_job_driver =3D { .run =3D mirror_run, .prepare =3D mirror_prepare, .abort =3D mirror_abort, + .clean =3D mirror_clean, .pause =3D mirror_pause, .complete =3D mirror_complete, }, @@ -1203,6 +1218,7 @@ static const BlockJobDriver commit_active_job_driver = =3D { .run =3D mirror_run, .prepare =3D mirror_prepare, .abort =3D mirror_abort, + .clean =3D mirror_clean, .pause =3D mirror_pause, .complete =3D mirror_complete, }, @@ -1550,7 +1566,10 @@ static BlockJob *mirror_start_job( BlockCompletionFunc *cb, void *opaque, const BlockJobDriver *driver, - bool is_none_mode, BlockDriverState *base, + MirrorSyncMode sync_mode, + BdrvDirtyBitmap *bitmap, + BitmapSyncMode bitmap_mode, + BlockDriverState *base, bool auto_complete, const char *filter_node_n= ame, bool is_mirror, MirrorCopyMode copy_mode, Error **errp) @@ -1563,10 +1582,39 @@ static BlockJob *mirror_start_job( Error *local_err =3D NULL; int ret; =20 - if (granularity =3D=3D 0) { - granularity =3D bdrv_get_default_bitmap_granularity(target); + if (sync_mode =3D=3D MIRROR_SYNC_MODE_INCREMENTAL) { + error_setg(errp, "Sync mode '%s' not supported", + MirrorSyncMode_str(sync_mode)); + return NULL; + } else if (sync_mode =3D=3D MIRROR_SYNC_MODE_BITMAP) { + if (!bitmap) { + error_setg(errp, "Must provide a valid bitmap name for '%s'" + " sync mode", + MirrorSyncMode_str(sync_mode)); + return NULL; + } else if (bitmap_mode !=3D BITMAP_SYNC_MODE_NEVER) { + error_setg(errp, + "Bitmap Sync Mode '%s' is not supported by Mirror", + BitmapSyncMode_str(bitmap_mode)); + } + } else if (bitmap) { + error_setg(errp, + "sync mode '%s' is not compatible with bitmaps", + MirrorSyncMode_str(sync_mode)); + return NULL; } =20 + if (bitmap) { + if (granularity) { + error_setg(errp, "granularity (%d)" + "cannot be specified when a bitmap is provided", + granularity); + return NULL; + } + granularity =3D bdrv_dirty_bitmap_granularity(bitmap); + } else if (granularity =3D=3D 0) { + granularity =3D bdrv_get_default_bitmap_granularity(target); + } assert(is_power_of_2(granularity)); =20 if (buf_size < 0) { @@ -1705,7 +1753,9 @@ static BlockJob *mirror_start_job( s->replaces =3D g_strdup(replaces); s->on_source_error =3D on_source_error; s->on_target_error =3D on_target_error; - s->is_none_mode =3D is_none_mode; + s->sync_mode =3D sync_mode; + s->sync_bitmap =3D bitmap; + s->bitmap_mode =3D bitmap_mode; s->backing_mode =3D backing_mode; s->zero_target =3D zero_target; s->copy_mode =3D copy_mode; @@ -1726,6 +1776,18 @@ static BlockJob *mirror_start_job( bdrv_disable_dirty_bitmap(s->dirty_bitmap); } =20 + if (s->sync_bitmap) { + bdrv_dirty_bitmap_set_busy(s->sync_bitmap, true); + } + + if (s->sync_mode =3D=3D MIRROR_SYNC_MODE_BITMAP) { + bdrv_merge_dirty_bitmap(s->dirty_bitmap, s->sync_bitmap, + NULL, &local_err); + if (local_err) { + goto fail; + } + } + ret =3D block_job_add_bdrv(&s->common, "source", bs, 0, BLK_PERM_WRITE_UNCHANGED | BLK_PERM_WRITE | BLK_PERM_CONSISTENT_READ, @@ -1803,6 +1865,9 @@ fail: if (s->dirty_bitmap) { bdrv_release_dirty_bitmap(s->dirty_bitmap); } + if (s->sync_bitmap) { + bdrv_dirty_bitmap_set_busy(s->sync_bitmap, false); + } job_early_fail(&s->common.job); } =20 @@ -1820,29 +1885,23 @@ void mirror_start(const char *job_id, BlockDriverSt= ate *bs, BlockDriverState *target, const char *replaces, int creation_flags, int64_t speed, uint32_t granularity, int64_t buf_size, - MirrorSyncMode mode, BlockMirrorBackingMode backing_mode, + MirrorSyncMode mode, BdrvDirtyBitmap *bitmap, + BitmapSyncMode bitmap_mode, + BlockMirrorBackingMode backing_mode, bool zero_target, BlockdevOnError on_source_error, BlockdevOnError on_target_error, bool unmap, const char *filter_node_name, MirrorCopyMode copy_mode, Error **errp) { - bool is_none_mode; BlockDriverState *base; =20 - if ((mode =3D=3D MIRROR_SYNC_MODE_INCREMENTAL) || - (mode =3D=3D MIRROR_SYNC_MODE_BITMAP)) { - error_setg(errp, "Sync mode '%s' not supported", - MirrorSyncMode_str(mode)); - return; - } - is_none_mode =3D mode =3D=3D MIRROR_SYNC_MODE_NONE; base =3D mode =3D=3D MIRROR_SYNC_MODE_TOP ? bdrv_backing_chain_next(bs= ) : NULL; mirror_start_job(job_id, bs, creation_flags, target, replaces, speed, granularity, buf_size, backing_mode, zero_targ= et, on_source_error, on_target_error, unmap, NULL, NULL, - &mirror_job_driver, is_none_mode, base, false, - filter_node_name, true, copy_mode, errp); + &mirror_job_driver, mode, bitmap, bitmap_mode, base, + false, filter_node_name, true, copy_mode, errp); } =20 BlockJob *commit_active_start(const char *job_id, BlockDriverState *bs, @@ -1868,7 +1927,8 @@ BlockJob *commit_active_start(const char *job_id, Blo= ckDriverState *bs, job_id, bs, creation_flags, base, NULL, speed, 0, 0, MIRROR_LEAVE_BACKING_CHAIN, false, on_error, on_error, true, cb, opaque, - &commit_active_job_driver, false, base, auto_complete, + &commit_active_job_driver, MIRROR_SYNC_MODE_FULL, + NULL, 0, base, auto_complete, filter_node_name, false, MIRROR_COPY_MODE_BACKGROUND, &local_err); if (local_err) { diff --git a/blockdev.c b/blockdev.c index 7f2561081e..6baa1a33f5 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2920,6 +2920,10 @@ static void blockdev_mirror_common(const char *job_i= d, BlockDriverState *bs, BlockDriverState *target, bool has_replaces, const char *replaces, enum MirrorSyncMode sync, + bool has_bitmap, + const char *bitmap_name, + bool has_bitmap_mode, + BitmapSyncMode bitmap_mode, BlockMirrorBackingMode backing_mode, bool zero_target, bool has_speed, int64_t speed, @@ -2939,6 +2943,7 @@ static void blockdev_mirror_common(const char *job_id= , BlockDriverState *bs, { BlockDriverState *unfiltered_bs; int job_flags =3D JOB_DEFAULT; + BdrvDirtyBitmap *bitmap =3D NULL; =20 if (!has_speed) { speed =3D 0; @@ -2993,6 +2998,29 @@ static void blockdev_mirror_common(const char *job_i= d, BlockDriverState *bs, sync =3D MIRROR_SYNC_MODE_FULL; } =20 + if (has_bitmap) { + if (granularity) { + error_setg(errp, "Granularity and bitmap cannot both be set"); + return; + } + + if (!has_bitmap_mode) { + error_setg(errp, "bitmap-mode must be specified if" + " a bitmap is provided"); + return; + } + + bitmap =3D bdrv_find_dirty_bitmap(bs, bitmap_name); + if (!bitmap) { + error_setg(errp, "Dirty bitmap '%s' not found", bitmap_name); + return; + } + + if (bdrv_dirty_bitmap_check(bitmap, BDRV_BITMAP_ALLOW_RO, errp)) { + return; + } + } + if (!has_replaces) { /* We want to mirror from @bs, but keep implicit filters on top */ unfiltered_bs =3D bdrv_skip_implicit_filters(bs); @@ -3039,8 +3067,8 @@ static void blockdev_mirror_common(const char *job_id= , BlockDriverState *bs, * and will allow to check whether the node still exist at mirror comp= letion */ mirror_start(job_id, bs, target, - has_replaces ? replaces : NULL, job_flags, - speed, granularity, buf_size, sync, backing_mode, zero_ta= rget, + has_replaces ? replaces : NULL, job_flags, speed, granula= rity, + buf_size, sync, bitmap, bitmap_mode, backing_mode, zero_t= arget, on_source_error, on_target_error, unmap, filter_node_name, copy_mode, errp); } @@ -3185,6 +3213,8 @@ void qmp_drive_mirror(DriveMirror *arg, Error **errp) =20 blockdev_mirror_common(arg->has_job_id ? arg->job_id : NULL, bs, targe= t_bs, arg->has_replaces, arg->replaces, arg->sync, + arg->has_bitmap, arg->bitmap, + arg->has_bitmap_mode, arg->bitmap_mode, backing_mode, zero_target, arg->has_speed, arg->speed, arg->has_granularity, arg->granularity, @@ -3206,6 +3236,8 @@ void qmp_blockdev_mirror(bool has_job_id, const char = *job_id, const char *device, const char *target, bool has_replaces, const char *replaces, MirrorSyncMode sync, + bool has_bitmap, const char *bitmap, + bool has_bitmap_mode, BitmapSyncMode bitmap_mode, bool has_speed, int64_t speed, bool has_granularity, uint32_t granularity, bool has_buf_size, int64_t buf_size, @@ -3255,7 +3287,8 @@ void qmp_blockdev_mirror(bool has_job_id, const char = *job_id, } =20 blockdev_mirror_common(has_job_id ? job_id : NULL, bs, target_bs, - has_replaces, replaces, sync, backing_mode, + has_replaces, replaces, sync, has_bitmap, + bitmap, has_bitmap_mode, bitmap_mode, backing_m= ode, zero_target, has_speed, speed, has_granularity, granularity, has_buf_size, buf_size, diff --git a/tests/test-block-iothread.c b/tests/test-block-iothread.c index 3f866a35c6..500ede71c8 100644 --- a/tests/test-block-iothread.c +++ b/tests/test-block-iothread.c @@ -623,8 +623,8 @@ static void test_propagate_mirror(void) =20 /* Start a mirror job */ mirror_start("job0", src, target, NULL, JOB_DEFAULT, 0, 0, 0, - MIRROR_SYNC_MODE_NONE, MIRROR_OPEN_BACKING_CHAIN, false, - BLOCKDEV_ON_ERROR_REPORT, BLOCKDEV_ON_ERROR_REPORT, + MIRROR_SYNC_MODE_NONE, NULL, 0, MIRROR_OPEN_BACKING_CHAIN, + false, BLOCKDEV_ON_ERROR_REPORT, BLOCKDEV_ON_ERROR_REPORT, false, "filter_node", MIRROR_COPY_MODE_BACKGROUND, &error_abort); job =3D job_get("job0"); diff --git a/qapi/block-core.json b/qapi/block-core.json index 2d94873ca0..dac5497084 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1961,10 +1961,19 @@ # (all the disk, only the sectors allocated in the topmost image, or # only new I/O). # +# @bitmap: The name of a bitmap to use for sync=3Dbitmap mode. This argume= nt must +# be present for bitmap mode and absent otherwise. The bitmap's +# granularity is used instead of @granularity (since 5.2). +# +# @bitmap-mode: Specifies the type of data the bitmap should contain after +# the operation concludes. Must be present if sync is "bitma= p". +# Must NOT be present otherwise. (Since 5.2) +# # @granularity: granularity of the dirty bitmap, default is 64K # if the image format doesn't have clusters, 4K if the clust= ers # are smaller than that, else the cluster size. Must be a -# power of 2 between 512 and 64M (since 1.4). +# power of 2 between 512 and 64M. Must not be specified if +# @bitmap is present (since 1.4). # # @buf-size: maximum amount of data in flight from source to # target (since 1.4). @@ -2002,7 +2011,9 @@ { 'struct': 'DriveMirror', 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str', '*format': 'str', '*node-name': 'str', '*replaces': 'str', - 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', + 'sync': 'MirrorSyncMode', '*bitmap': 'str', + '*bitmap-mode': 'BitmapSyncMode', + '*mode': 'NewImageMode', '*speed': 'int', '*granularity': 'uint32', '*buf-size': 'int', '*on-source-error': 'BlockdevOnError', '*on-target-error': 'BlockdevOnError', @@ -2270,10 +2281,19 @@ # (all the disk, only the sectors allocated in the topmost image, or # only new I/O). # +# @bitmap: The name of a bitmap to use for sync=3Dbitmap mode. This argume= nt must +# be present for bitmap mode and absent otherwise. The bitmap's +# granularity is used instead of @granularity (since 5.2). +# +# @bitmap-mode: Specifies the type of data the bitmap should contain after +# the operation concludes. Must be present if sync is "bitma= p". +# Must NOT be present otherwise. (Since 5.2) +# # @granularity: granularity of the dirty bitmap, default is 64K # if the image format doesn't have clusters, 4K if the clust= ers # are smaller than that, else the cluster size. Must be a -# power of 2 between 512 and 64M +# power of 2 between 512 and 64M . Must not be specified if +# @bitmap is present. # # @buf-size: maximum amount of data in flight from source to # target @@ -2322,7 +2342,8 @@ { 'command': 'blockdev-mirror', 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str', '*replaces': 'str', - 'sync': 'MirrorSyncMode', + 'sync': 'MirrorSyncMode', '*bitmap': 'str', + '*bitmap-mode': 'BitmapSyncMode', '*speed': 'int', '*granularity': 'uint32', '*buf-size': 'int', '*on-source-error': 'BlockdevOnError', '*on-target-error': 'BlockdevOnError', --=20 2.20.1 From nobody Wed May 1 19:05:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600766926; cv=none; d=zohomail.com; s=zohoarc; b=ZcUqKKhDG+iFw49U8iRWklRiVkHW+eC3doJhrJyKi6brvLZ3wiFyBWeKk2bIJ33R52uh7gmtU8aT2THRZKa4xQfHfKlxJ8DaN/+fNKLFeSMk/7TkkCZyc8bWoQT4P95yJ/FrYKyGfPG7r4SnyWPfMOxZxqBfbib0AQ0POCNH9tQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600766926; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mo6ecc9X3i23/WJn95SMzcbWz9ogA/Y9N4mqRkCqqVI=; b=d1i+MjzqsRXKAuTUCmYHqPwMcCliq+pXdXdBxC6PfXLCt3DcWghT7gleBpOrdfK0a0Id4esLiJ+cd/EqX6OL1k11JrHO43uJx4+8UvYjeTjIzKwzrs6hH8r8jXzwWxkFXi3lsHYdbGj3wOyniHSy15wx9gXPhWCMEPwFNhQvJQE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600766926396766.2420881722187; Tue, 22 Sep 2020 02:28:46 -0700 (PDT) Received: from localhost ([::1]:60652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKebN-0001U2-32 for importer@patchew.org; Tue, 22 Sep 2020 05:28:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKeW0-0002Ck-9L; Tue, 22 Sep 2020 05:23:12 -0400 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:23413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKeVx-0005cY-90; Tue, 22 Sep 2020 05:23:11 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 3EA55454AE; Tue, 22 Sep 2020 11:14:33 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: qemu-devel@nongnu.org Subject: [PATCH qemu 2/4] drive-mirror: add support for conditional and always bitmap sync modes Date: Tue, 22 Sep 2020 11:14:16 +0200 Message-Id: <20200922091418.53562-3-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200922091418.53562-1-f.gruenbichler@proxmox.com> References: <20200922091418.53562-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.186.127.180; envelope-from=f.gruenbichler@proxmox.com; helo=proxmox-new.maurer-it.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 05:14:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Markus Armbruster , Max Reitz , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: John Snow Teach mirror two new tricks for using bitmaps: Always: no matter what, we synchronize the copy_bitmap back to the sync_bitmap. In effect, this allows us resume a failed mirror at a later date, since the target bdrv should be exactly in the state referenced by the bitmap. Conditional: On success only, we sync the bitmap. This is akin to incremental backup modes; we can use this bitmap to later refresh a successfully created mirror, or possibly re-try the whole failed mirror if we are able to rollback the target to the state before starting the mirror. Based on original work by John Snow. Signed-off-by: Fabian Gr=C3=BCnbichler --- block/mirror.c | 28 ++++++++++++++++++++-------- blockdev.c | 3 +++ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index d64c8203ef..bc4f4563d9 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -654,8 +654,6 @@ static int mirror_exit_common(Job *job) bdrv_unfreeze_backing_chain(mirror_top_bs, target_bs); } =20 - bdrv_release_dirty_bitmap(s->dirty_bitmap); - /* Make sure that the source BDS doesn't go away during bdrv_replace_n= ode, * before we can call bdrv_drained_end */ bdrv_ref(src); @@ -755,6 +753,18 @@ static int mirror_exit_common(Job *job) blk_set_perm(bjob->blk, 0, BLK_PERM_ALL, &error_abort); blk_insert_bs(bjob->blk, mirror_top_bs, &error_abort); =20 + if (s->sync_bitmap) { + if (s->bitmap_mode =3D=3D BITMAP_SYNC_MODE_ALWAYS || + (s->bitmap_mode =3D=3D BITMAP_SYNC_MODE_ON_SUCCESS && + job->ret =3D=3D 0 && ret =3D=3D 0)) { + /* Success; synchronize copy back to sync. */ + bdrv_clear_dirty_bitmap(s->sync_bitmap, NULL); + bdrv_dirty_bitmap_merge_internal(s->sync_bitmap, s->dirty_bitm= ap, + NULL, true); + } + } + bdrv_release_dirty_bitmap(s->dirty_bitmap); + bs_opaque->job =3D NULL; =20 bdrv_drained_end(src); @@ -1592,10 +1602,6 @@ static BlockJob *mirror_start_job( " sync mode", MirrorSyncMode_str(sync_mode)); return NULL; - } else if (bitmap_mode !=3D BITMAP_SYNC_MODE_NEVER) { - error_setg(errp, - "Bitmap Sync Mode '%s' is not supported by Mirror", - BitmapSyncMode_str(bitmap_mode)); } } else if (bitmap) { error_setg(errp, @@ -1612,6 +1618,12 @@ static BlockJob *mirror_start_job( return NULL; } granularity =3D bdrv_dirty_bitmap_granularity(bitmap); + + if (bitmap_mode !=3D BITMAP_SYNC_MODE_NEVER) { + if (bdrv_dirty_bitmap_check(bitmap, BDRV_BITMAP_DEFAULT, errp)= ) { + return NULL; + } + } } else if (granularity =3D=3D 0) { granularity =3D bdrv_get_default_bitmap_granularity(target); } @@ -1781,8 +1793,8 @@ static BlockJob *mirror_start_job( } =20 if (s->sync_mode =3D=3D MIRROR_SYNC_MODE_BITMAP) { - bdrv_merge_dirty_bitmap(s->dirty_bitmap, s->sync_bitmap, - NULL, &local_err); + bdrv_dirty_bitmap_merge_internal(s->dirty_bitmap, s->sync_bitmap, + NULL, true); if (local_err) { goto fail; } diff --git a/blockdev.c b/blockdev.c index 6baa1a33f5..0fd30a392d 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3019,6 +3019,9 @@ static void blockdev_mirror_common(const char *job_id= , BlockDriverState *bs, if (bdrv_dirty_bitmap_check(bitmap, BDRV_BITMAP_ALLOW_RO, errp)) { return; } + } else if (has_bitmap_mode) { + error_setg(errp, "Cannot specify bitmap sync mode without a bitmap= "); + return; } =20 if (!has_replaces) { --=20 2.20.1 From nobody Wed May 1 19:05:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600767065; cv=none; d=zohomail.com; s=zohoarc; b=cIbafBQrCYMzom9Eio7m5GJc1IchS3gYROUXYGJRbNpeMjB/+D5dThay6iViugBTQwK3KaKjMh1mZqqsSf1QyY/ZQTZjPHN2Z60Lyo9QvMr94LvHNo8rGejIMp4W3G3xjPJe3Yd0o9uDcpCgFEF9LUiWtG6imCuWNcfDD/8/Ibk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600767065; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UHCqyc2MZ/jcwA4elVheAvrkmA56floi1DNmfjee6c4=; b=F0O7R74EVEcqy3ynsiakZn+nJSYf5vjamC5PQIS51m+tWaq2fi/EdO5+WF2ZObYTuCyf7vUfIDMJHGQqTLdPcyGMMtGE1rXoXAxQq8vSRHjf4PHWPJdzE1eyUS4ap5tKZuhfFM69tP3EBCfKIfE1L5n5yzkHYm1JhlgH3HrLvko= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600767065546973.9533566672998; Tue, 22 Sep 2020 02:31:05 -0700 (PDT) Received: from localhost ([::1]:38938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKedc-0004GA-6q for importer@patchew.org; Tue, 22 Sep 2020 05:31:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKeW1-0002E8-0e; Tue, 22 Sep 2020 05:23:13 -0400 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:48959) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKeVy-0005ca-15; Tue, 22 Sep 2020 05:23:12 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id C5701454B8; Tue, 22 Sep 2020 11:14:36 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: qemu-devel@nongnu.org Subject: [PATCH qemu 3/4] mirror: move some checks to qmp Date: Tue, 22 Sep 2020 11:14:17 +0200 Message-Id: <20200922091418.53562-4-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200922091418.53562-1-f.gruenbichler@proxmox.com> References: <20200922091418.53562-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.186.127.180; envelope-from=f.gruenbichler@proxmox.com; helo=proxmox-new.maurer-it.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 05:14:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Markus Armbruster , Max Reitz , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" and assert the passing conditions in block/mirror.c. while incremental mode was never available for drive-mirror, it makes the interface more in line with backup block jobs. Signed-off-by: Fabian Gr=C3=BCnbichler Reviewed-by: Max Reitz --- block/mirror.c | 28 +++++----------------------- blockdev.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index bc4f4563d9..fe70f9b93c 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1592,31 +1592,13 @@ static BlockJob *mirror_start_job( Error *local_err =3D NULL; int ret; =20 - if (sync_mode =3D=3D MIRROR_SYNC_MODE_INCREMENTAL) { - error_setg(errp, "Sync mode '%s' not supported", - MirrorSyncMode_str(sync_mode)); - return NULL; - } else if (sync_mode =3D=3D MIRROR_SYNC_MODE_BITMAP) { - if (!bitmap) { - error_setg(errp, "Must provide a valid bitmap name for '%s'" - " sync mode", - MirrorSyncMode_str(sync_mode)); - return NULL; - } - } else if (bitmap) { - error_setg(errp, - "sync mode '%s' is not compatible with bitmaps", - MirrorSyncMode_str(sync_mode)); - return NULL; - } + /* QMP interface protects us from these cases */ + assert(sync_mode !=3D MIRROR_SYNC_MODE_INCREMENTAL); + assert((bitmap && sync_mode =3D=3D MIRROR_SYNC_MODE_BITMAP) || + (!bitmap && sync_mode !=3D MIRROR_SYNC_MODE_BITMAP)); + assert(!(bitmap && granularity)); =20 if (bitmap) { - if (granularity) { - error_setg(errp, "granularity (%d)" - "cannot be specified when a bitmap is provided", - granularity); - return NULL; - } granularity =3D bdrv_dirty_bitmap_granularity(bitmap); =20 if (bitmap_mode !=3D BITMAP_SYNC_MODE_NEVER) { diff --git a/blockdev.c b/blockdev.c index 0fd30a392d..3b090cc749 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2998,7 +2998,36 @@ static void blockdev_mirror_common(const char *job_i= d, BlockDriverState *bs, sync =3D MIRROR_SYNC_MODE_FULL; } =20 + if ((sync =3D=3D MIRROR_SYNC_MODE_BITMAP) || + (sync =3D=3D MIRROR_SYNC_MODE_INCREMENTAL)) { + /* done before desugaring 'incremental' to print the right message= */ + if (!has_bitmap) { + error_setg(errp, "Must provide a valid bitmap name for " + "'%s' sync mode", MirrorSyncMode_str(sync)); + return; + } + } + + if (sync =3D=3D MIRROR_SYNC_MODE_INCREMENTAL) { + if (has_bitmap_mode && + bitmap_mode !=3D BITMAP_SYNC_MODE_ON_SUCCESS) { + error_setg(errp, "Bitmap sync mode must be '%s' " + "when using sync mode '%s'", + BitmapSyncMode_str(BITMAP_SYNC_MODE_ON_SUCCESS), + MirrorSyncMode_str(sync)); + return; + } + has_bitmap_mode =3D true; + sync =3D MIRROR_SYNC_MODE_BITMAP; + bitmap_mode =3D BITMAP_SYNC_MODE_ON_SUCCESS; + } + if (has_bitmap) { + if (sync !=3D MIRROR_SYNC_MODE_BITMAP) { + error_setg(errp, "Sync mode '%s' not supported with bitmap.", + MirrorSyncMode_str(sync)); + return; + } if (granularity) { error_setg(errp, "Granularity and bitmap cannot both be set"); return; --=20 2.20.1 From nobody Wed May 1 19:05:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1600767016; cv=none; d=zohomail.com; s=zohoarc; b=khS2r90zZWoyAtq+99JuVBMCGk2CQPqCVqKVms1vevFO+53SoB4UI+EnDdUR6P9iT8khdVy16O98dD55tFF/cbO8R8TGLwwZoaF7XoVzTEnurCSwQcBPxrrOp7KUnoIazo13eU9THMk33/qBIwXSYMwht68uw5DwJ+kJI7lQ6oU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600767016; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+K2Nz5Tvgj/oB6XTGsS2sen/dDnt8nqy9vJDYfkjVfE=; b=FbpGUl+Yp0WF2G63hmxREoQZHwvn0KivqAawIscOxQjvAZOWLMsRujJk+GVXetVJFlUHwQfbq7VhJcEzQUl4GcvqyqdVN5RQyyN2s9KbSB9ZRyLev++o0hbEobnmKPNHs6m3efJeInVL69KYXtRak6wDJ1KR3vHh2LtAsV0wl68= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600767016209791.0661450490002; Tue, 22 Sep 2020 02:30:16 -0700 (PDT) Received: from localhost ([::1]:36662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKeco-0003CJ-CO for importer@patchew.org; Tue, 22 Sep 2020 05:30:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKeW3-0002Jx-W5; Tue, 22 Sep 2020 05:23:16 -0400 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:55268) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKeVx-0005cb-4d; Tue, 22 Sep 2020 05:23:15 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 61C15454B9; Tue, 22 Sep 2020 11:14:44 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: qemu-devel@nongnu.org Subject: [PATCH qemu 4/4] iotests: add test for bitmap mirror Date: Tue, 22 Sep 2020 11:14:18 +0200 Message-Id: <20200922091418.53562-5-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200922091418.53562-1-f.gruenbichler@proxmox.com> References: <20200922091418.53562-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.186.127.180; envelope-from=f.gruenbichler@proxmox.com; helo=proxmox-new.maurer-it.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 05:14:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Markus Armbruster , Max Reitz , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" heavily based on/practically forked off iotest 257 for bitmap backups, but: - no writes to filter node 'mirror-top' between completion and finalization, as those seem to deadlock? - no inclusion of not-yet-available full/top sync modes in combination with bitmaps - extra set of reference/test mirrors to verify that writes in parallel with active mirror work intentionally keeping copyright and ownership of original test case to honor provenance. Signed-off-by: Fabian Gr=C3=BCnbichler --- tests/qemu-iotests/306 | 546 +++++++ tests/qemu-iotests/306.out | 2846 ++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 3393 insertions(+) create mode 100755 tests/qemu-iotests/306 create mode 100644 tests/qemu-iotests/306.out diff --git a/tests/qemu-iotests/306 b/tests/qemu-iotests/306 new file mode 100755 index 0000000000..1bb8bd4138 --- /dev/null +++ b/tests/qemu-iotests/306 @@ -0,0 +1,546 @@ +#!/usr/bin/env python3 +# +# Test bitmap-sync mirrors (incremental, differential, and partials) +# +# Copyright (c) 2019 John Snow for Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# owner=3Djsnow@redhat.com + +import math +import os + +import iotests +from iotests import log, qemu_img + +SIZE =3D 64 * 1024 * 1024 +GRANULARITY =3D 64 * 1024 + + +class Pattern: + def __init__(self, byte, offset, size=3DGRANULARITY): + self.byte =3D byte + self.offset =3D offset + self.size =3D size + + def bits(self, granularity): + lower =3D self.offset // granularity + upper =3D (self.offset + self.size - 1) // granularity + return set(range(lower, upper + 1)) + + +class PatternGroup: + """Grouping of Pattern objects. Initialize with an iterable of Pattern= s.""" + def __init__(self, patterns): + self.patterns =3D patterns + + def bits(self, granularity): + """Calculate the unique bits dirtied by this pattern grouping""" + res =3D set() + for pattern in self.patterns: + res |=3D pattern.bits(granularity) + return res + + +GROUPS =3D [ + PatternGroup([ + # Batch 0: 4 clusters + Pattern('0x49', 0x0000000), + Pattern('0x6c', 0x0100000), # 1M + Pattern('0x6f', 0x2000000), # 32M + Pattern('0x76', 0x3ff0000)]), # 64M - 64K + PatternGroup([ + # Batch 1: 6 clusters (3 new) + Pattern('0x65', 0x0000000), # Full overwrite + Pattern('0x77', 0x00f8000), # Partial-left (1M-32K) + Pattern('0x72', 0x2008000), # Partial-right (32M+32K) + Pattern('0x69', 0x3fe0000)]), # Adjacent-left (64M - 128K) + PatternGroup([ + # Batch 2: 7 clusters (3 new) + Pattern('0x74', 0x0010000), # Adjacent-right + Pattern('0x69', 0x00e8000), # Partial-left (1M-96K) + Pattern('0x6e', 0x2018000), # Partial-right (32M+96K) + Pattern('0x67', 0x3fe0000, + 2*GRANULARITY)]), # Overwrite [(64M-128K)-64M) + PatternGroup([ + # Batch 3: 8 clusters (5 new) + # Carefully chosen such that nothing re-dirties the one cluster + # that copies out successfully before failure in Group #1. + Pattern('0xaa', 0x0010000, + 3*GRANULARITY), # Overwrite and 2x Adjacent-right + Pattern('0xbb', 0x00d8000), # Partial-left (1M-160K) + Pattern('0xcc', 0x2028000), # Partial-right (32M+160K) + Pattern('0xdd', 0x3fc0000)]), # New; leaving a gap to the right +] + + +class EmulatedBitmap: + def __init__(self, granularity=3DGRANULARITY): + self._bits =3D set() + self.granularity =3D granularity + + def dirty_bits(self, bits): + self._bits |=3D set(bits) + + def dirty_group(self, n): + self.dirty_bits(GROUPS[n].bits(self.granularity)) + + def clear(self): + self._bits =3D set() + + def clear_bits(self, bits): + self._bits -=3D set(bits) + + def clear_bit(self, bit): + self.clear_bits({bit}) + + def clear_group(self, n): + self.clear_bits(GROUPS[n].bits(self.granularity)) + + @property + def first_bit(self): + return sorted(self.bits)[0] + + @property + def bits(self): + return self._bits + + @property + def count(self): + return len(self.bits) + + def compare(self, qmp_bitmap): + """ + Print a nice human-readable message checking that a bitmap as repo= rted + by the QMP interface has as many bits set as we expect it to. + """ + + name =3D qmp_bitmap.get('name', '(anonymous)') + log("=3D Checking Bitmap {:s} =3D".format(name)) + + want =3D self.count + have =3D qmp_bitmap['count'] // qmp_bitmap['granularity'] + + log("expecting {:d} dirty sectors; have {:d}. {:s}".format( + want, have, "OK!" if want =3D=3D have else "ERROR!")) + log('') + + +class Drive: + """Represents, vaguely, a drive attached to a VM. + Includes format, graph, and device information.""" + + def __init__(self, path, vm=3DNone): + self.path =3D path + self.vm =3D vm + self.fmt =3D None + self.size =3D None + self.node =3D None + + def img_create(self, fmt, size): + self.fmt =3D fmt + self.size =3D size + iotests.qemu_img_create('-f', self.fmt, self.path, str(self.size)) + + def create_target(self, name, fmt, size): + basename =3D os.path.basename(self.path) + file_node_name =3D "file_{}".format(basename) + vm =3D self.vm + + log(vm.command('blockdev-create', job_id=3D'bdc-file-job', + options=3D{ + 'driver': 'file', + 'filename': self.path, + 'size': 0, + })) + vm.run_job('bdc-file-job') + log(vm.command('blockdev-add', driver=3D'file', + node_name=3Dfile_node_name, filename=3Dself.path)) + + log(vm.command('blockdev-create', job_id=3D'bdc-fmt-job', + options=3D{ + 'driver': fmt, + 'file': file_node_name, + 'size': size, + })) + vm.run_job('bdc-fmt-job') + log(vm.command('blockdev-add', driver=3Dfmt, + node_name=3Dname, + file=3Dfile_node_name)) + self.fmt =3D fmt + self.size =3D size + self.node =3D name + +def blockdev_mirror(vm, device, target, sync, **kwargs): + # Strip any arguments explicitly nulled by the caller: + kwargs =3D {key: val for key, val in kwargs.items() if val is not None} + result =3D vm.qmp_log('blockdev-mirror', + device=3Ddevice, + target=3Dtarget, + sync=3Dsync, + filter_node_name=3D'mirror-top', + **kwargs) + return result + +def blockdev_mirror_mktarget(drive, target_id, filepath, sync, **kwargs): + target_drive =3D Drive(filepath, vm=3Ddrive.vm) + target_drive.create_target(target_id, drive.fmt, drive.size) + blockdev_mirror(drive.vm, drive.node, target_id, sync, **kwargs) + +def reference_mirror(drive, n, filepath): + log("--- Reference mirror #{:d} ---\n".format(n)) + target_id =3D "ref_target_{:d}".format(n) + job_id =3D "ref_mirror_{:d}".format(n) + blockdev_mirror_mktarget(drive, target_id, filepath, "full", + job_id=3Djob_id) + drive.vm.run_job(job_id, auto_dismiss=3DTrue) + log('') + +def mirror(drive, n, filepath, sync, **kwargs): + log("--- Test mirror #{:d} ---\n".format(n)) + target_id =3D "mirror_target_{:d}".format(n) + job_id =3D "mirror_{:d}".format(n) + kwargs.setdefault('auto-finalize', False) + blockdev_mirror_mktarget(drive, target_id, filepath, sync, + job_id=3Djob_id, **kwargs) + return job_id + +def perform_writes(drive, n, filter_node_name=3DNone): + log("--- Write #{:d} ---\n".format(n)) + for pattern in GROUPS[n].patterns: + cmd =3D "write -P{:s} 0x{:07x} 0x{:x}".format( + pattern.byte, + pattern.offset, + pattern.size) + log(cmd) + log(drive.vm.hmp_qemu_io(filter_node_name or drive.node, cmd)) + bitmaps =3D drive.vm.query_bitmaps() + log({'bitmaps': bitmaps}, indent=3D2) + log('') + return bitmaps + + +def compare_images(image, reference, baseimg=3DNone, expected_match=3DTrue= ): + """ + Print a nice human-readable message comparing these images. + """ + expected_ret =3D 0 if expected_match else 1 + if baseimg: + assert qemu_img("rebase", "-u", "-b", baseimg, image) =3D=3D 0 + ret =3D qemu_img("compare", image, reference) + log('qemu_img compare "{:s}" "{:s}" =3D=3D> {:s}, {:s}'.format( + image, reference, + "Identical" if ret =3D=3D 0 else "Mismatch", + "OK!" if ret =3D=3D expected_ret else "ERROR!"), + filters=3D[iotests.filter_testfiles]) + +def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap', failure=3DNone): + """ + Test bitmap mirror routines. + + :param bsync_mode: Is the Bitmap Sync mode, and can be any of: + - on-success: This is the "incremental" style mode. Bitmaps are + synchronized to what was copied out only on success. + (Partial images must be discarded.) + - never: This is the "differential" style mode. + Bitmaps are never synchronized. + - always: This is a "best effort" style mode. + Bitmaps are always synchronized, regardless of failu= re. + (Partial images must be kept.) + + :param msync_mode: The mirror sync mode to use for the first mirror. + Can be any one of: + - bitmap: mirrors based on bitmap manifest. + - full: Full mirrors. + - top: Full mirrors of the top layer only. + + :param failure: Is the (optional) failure mode, and can be any of: + - None: No failure. Test the normative path. Default. + - simulated: Cancel the job right before it completes. + This also tests writes "during" the job. + - intermediate: This tests a job that fails mid-process and produc= es + an incomplete mirror. Testing limitations prevent + testing competing writes. + """ + with iotests.FilePath('img', 'bsync1', 'bsync2', 'bsync3', + 'fmirror0', 'fmirror1', 'fmirror2', 'fmirror3'= ) as \ + (img_path, bsync1, bsync2, bsync3, + fmirror0, fmirror1, fmirror2, fmirror3), \ + iotests.VM() as vm: + + mode =3D "Mode {:s}; Bitmap Sync {:s}".format(msync_mode, bsync_mo= de) + preposition =3D "with" if failure else "without" + cond =3D "{:s} {:s}".format(preposition, + "{:s} failure".format(failure) if failure + else "failure") + log("\n=3D=3D=3D {:s} {:s} =3D=3D=3D\n".format(mode, cond)) + + log('--- Preparing image & VM ---\n') + drive0 =3D Drive(img_path, vm=3Dvm) + drive0.img_create(iotests.imgfmt, SIZE) + vm.add_device("{},id=3Dscsi0".format(iotests.get_virtio_scsi_devic= e())) + vm.launch() + + file_config =3D { + 'driver': 'file', + 'filename': drive0.path + } + + if failure =3D=3D 'intermediate': + file_config =3D { + 'driver': 'blkdebug', + 'image': file_config, + 'set-state': [{ + 'event': 'flush_to_disk', + 'state': 1, + 'new_state': 2 + }, { + 'event': 'read_aio', + 'state': 2, + 'new_state': 3 + }, { + 'event': 'read_aio', + 'state': 3, + 'new_state': 4 + }], + 'inject-error': [{ + 'event': 'read_aio', + 'errno': 5, + 'state': 3, + 'immediately': False, + 'once': True + }, { + 'event': 'read_aio', + 'errno': 5, + 'state': 4, + 'immediately': False, + 'once': True + }] + } + + drive0.node =3D 'drive0' + vm.qmp_log('blockdev-add', + filters=3D[iotests.filter_qmp_testfiles], + node_name=3Ddrive0.node, + driver=3Ddrive0.fmt, + file=3Dfile_config) + log('') + + # 0 - Writes and Reference mirror + perform_writes(drive0, 0) + reference_mirror(drive0, 0, fmirror0) + log('--- Add Bitmap ---\n') + vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.node, + name=3D"bitmap0", granularity=3DGRANULARITY) + log('') + ebitmap =3D EmulatedBitmap() + + # 1 - Writes and Reference mirror + bitmaps =3D perform_writes(drive0, 1) + ebitmap.dirty_group(1) + bitmap =3D vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbitmaps) + ebitmap.compare(bitmap) + reference_mirror(drive0, 1, fmirror1) + + # 1 - Test mirror (w/ Optional induced failure) + if failure =3D=3D 'intermediate': + # Activate blkdebug induced failure for second-to-next read + log(vm.hmp_qemu_io(drive0.node, 'flush')) + log('') + job =3D mirror(drive0, 1, bsync1, msync_mode, + bitmap=3D"bitmap0", bitmap_mode=3Dbsync_mode) + + vm.run_job(job, auto_dismiss=3DTrue, auto_finalize=3DFalse, + cancel=3D(failure =3D=3D 'simulated')) + bitmaps =3D vm.query_bitmaps() + log({'bitmaps': bitmaps}, indent=3D2) + log('') + + if bsync_mode =3D=3D 'always': + if failure =3D=3D 'intermediate': + # We manage to copy one sector (one bit) before the error. + ebitmap.clear_bit(ebitmap.first_bit) + else: + # successful mirror / cancelled complete mirror + ebitmap.clear() + + if bsync_mode =3D=3D 'on-success' and not failure: + ebitmap.clear() + + ebitmap.compare(vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbi= tmaps)) + + # 2 - Reference mirror + reference_mirror(drive0, 2, fmirror2) + + # 2 - Bitmap mirror with writes before completion + job =3D mirror(drive0, 2, bsync2, "bitmap", + bitmap=3D"bitmap0", bitmap_mode=3Dbsync_mode) + + bitmaps =3D perform_writes(drive0, 2) + ebitmap.dirty_group(2) + ebitmap.compare(vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbi= tmaps)) + + # don't use run_job as that logs too much even with use_log=3DFalse + events =3D [('JOB_STATUS_CHANGE', {'data': {'id': job}})] + while True: + ev =3D iotests.filter_qmp_event(vm.events_wait(events, timeout= =3D10)) + status =3D ev['data']['status'] + if status =3D=3D 'ready': + vm.qmp('job-complete', id=3Djob) + elif status =3D=3D 'standby': + vm.qmp('job-resume', id=3Djob) + elif status =3D=3D 'pending': + vm.qmp('job-finalize', id=3Djob) + elif status =3D=3D 'null': + break + + if bsync_mode !=3D 'never': + ebitmap.clear() + + bitmaps =3D vm.query_bitmaps() + ebitmap.compare(vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbi= tmaps)) + + # 3 - Writes and Reference mirror + bitmaps =3D perform_writes(drive0, 3) + ebitmap.dirty_group(3) + ebitmap.compare(vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbi= tmaps)) + reference_mirror(drive0, 3, fmirror3) + + # 3 - Bitmap mirror (In failure modes, this is a recovery.) + job =3D mirror(drive0, 3, bsync3, "bitmap", + bitmap=3D"bitmap0", bitmap_mode=3Dbsync_mode) + + vm.run_job(job, auto_dismiss=3DTrue, auto_finalize=3DFalse) + bitmaps =3D vm.query_bitmaps() + + log({'bitmaps': bitmaps}, indent=3D2) + log('') + if bsync_mode !=3D 'never': + ebitmap.clear() + ebitmap.compare(vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbi= tmaps)) + + log('--- Cleanup ---\n') + vm.qmp_log("block-dirty-bitmap-remove", + node=3Ddrive0.node, name=3D"bitmap0") + bitmaps =3D vm.query_bitmaps() + log({'bitmaps': bitmaps}, indent=3D2) + vm.shutdown() + log('') + + log('--- Verification ---\n') + compare_images(bsync1, fmirror1, baseimg=3Dfmirror0, + expected_match=3Dfailure !=3D 'intermediate') + if not failure or bsync_mode =3D=3D 'always': + # Always keep the last mirror on success or when using 'always' + base =3D bsync1 + else: + base =3D fmirror1 + + compare_images(bsync2, fmirror2, baseimg=3Dbase, expected_match=3D= 0) + compare_images(bsync3, fmirror3, baseimg=3Dbsync2) + compare_images(img_path, fmirror3) + log('') + +def test_mirror_api(): + """ + Test malformed and prohibited invocations of the mirror API. + """ + with iotests.FilePath('img', 'bsync1') as (img_path, mirror_path), \ + iotests.VM() as vm: + + log("\n=3D=3D=3D API failure tests =3D=3D=3D\n") + log('--- Preparing image & VM ---\n') + drive0 =3D Drive(img_path, vm=3Dvm) + drive0.img_create(iotests.imgfmt, SIZE) + vm.add_device("{},id=3Dscsi0".format(iotests.get_virtio_scsi_devic= e())) + vm.launch() + + file_config =3D { + 'driver': 'file', + 'filename': drive0.path + } + + drive0.node =3D 'drive0' + vm.qmp_log('blockdev-add', + filters=3D[iotests.filter_qmp_testfiles], + node_name=3Ddrive0.node, + driver=3Ddrive0.fmt, + file=3Dfile_config) + log('') + + target0 =3D Drive(mirror_path, vm=3Dvm) + target0.create_target("mirror_target", drive0.fmt, drive0.size) + log('') + + vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.node, + name=3D"bitmap0", granularity=3DGRANULARITY) + log('') + + log('-- Testing invalid QMP commands --\n') + + error_cases =3D { + 'incremental': { + None: ['on-success', 'always', 'never', None], + 'bitmap404': ['on-success', 'always', 'never', None], + 'bitmap0': ['always', 'never'] + }, + 'bitmap': { + None: ['on-success', 'always', 'never', None], + 'bitmap404': ['on-success', 'always', 'never', None], + 'bitmap0': [None], + }, + 'full': { + None: ['on-success', 'always', 'never'], + 'bitmap404': ['on-success', 'always', 'never', None], + 'bitmap0': ['on-success', 'always', 'never', None], + }, + 'top': { + None: ['on-success', 'always', 'never'], + 'bitmap404': ['on-success', 'always', 'never', None], + 'bitmap0': ['on-success', 'always', 'never', None], + }, + 'none': { + None: ['on-success', 'always', 'never'], + 'bitmap404': ['on-success', 'always', 'never', None], + 'bitmap0': ['on-success', 'always', 'never', None], + } + } + + # Dicts, as always, are not stably-ordered prior to 3.7, so use tu= ples: + for sync_mode in ('incremental', 'bitmap', 'full', 'top', 'none'): + log("-- Sync mode {:s} tests --\n".format(sync_mode)) + for bitmap in (None, 'bitmap404', 'bitmap0'): + for policy in error_cases[sync_mode][bitmap]: + blockdev_mirror(drive0.vm, drive0.node, "mirror_target= ", + sync_mode, job_id=3D'api_job', + bitmap=3Dbitmap, bitmap_mode=3Dpolicy) + log('') + + +def main(): + for bsync_mode in ("never", "on-success", "always"): + for failure in ("simulated", "intermediate", None): + test_bitmap_sync(bsync_mode, "bitmap", failure) + +# for sync_mode in ('full', 'top'): +# for bsync_mode in ('on-success', 'always'): +# for failure in ('simulated', 'intermediate', None): +# test_bitmap_sync(bsync_mode, sync_mode, failure) + + test_mirror_api() + +if __name__ =3D=3D '__main__': + iotests.script_main(main, supported_fmts=3D['qcow2'], + supported_protocols=3D['file']) diff --git a/tests/qemu-iotests/306.out b/tests/qemu-iotests/306.out new file mode 100644 index 0000000000..06a2e29058 --- /dev/null +++ b/tests/qemu-iotests/306.out @@ -0,0 +1,2846 @@ + +=3D=3D=3D Mode bitmap; Bitmap Sync never with simulated failure =3D=3D=3D + +--- Preparing image & VM --- + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": {} +} + +--- Reference mirror #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_0", "sync": "full", "target"= : "ref_target_0"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_0"}} +{"return": {}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Add Bitmap --- + +{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, = "name": "bitmap0", "node": "drive0"}} +{"return": {}} + +--- Write #1 --- + +write -P0x65 0x0000000 0x10000 +{"return": ""} +write -P0x77 0x00f8000 0x10000 +{"return": ""} +write -P0x72 0x2008000 0x10000 +{"return": ""} +write -P0x69 0x3fe0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_1", "sync": "full", "target"= : "ref_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_1"}} +{"return": {}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "mirror-top", "job-id": "mirror_1", "sync": "bitmap", "target": "mirro= r_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-cancel", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"id": "mirror_1", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_2", "sync": "full", "target"= : "ref_target_2"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_2"}} +{"return": {}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "mirror-top", "job-id": "mirror_2", "sync": "bitmap", "target": "mirro= r_target_2"}} +{"return": {}} +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 262144, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 655360, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "locked" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 10 dirty sectors; have 10. OK! + +=3D Checking Bitmap bitmap0 =3D +expecting 10 dirty sectors; have 10. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 15 dirty sectors; have 15. OK! + +--- Reference mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_3", "sync": "full", "target"= : "ref_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_3"}} +{"return": {}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "mirror-top", "job-id": "mirror_3", "sync": "bitmap", "target": "mirro= r_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"device": "mirror_3", "len": 983040, "offset": 983040, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"id": "mirror_3", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_3", "len": 983040, "offset": 983040, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 15 dirty sectors; have 15. OK! + +--- Cleanup --- + +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} +{"return": {}} +{ + "bitmaps": {} +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fmirror1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fmirror2" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync3" "TEST_DIR/PID-fmirror3" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fmirror3" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode bitmap; Bitmap Sync never with intermediate failure =3D=3D= =3D + +--- Preparing image & VM --- + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "blkdebug", "image": {"driver": "file", "filename": "TEST_DIR/PID-img= "}, "inject-error": [{"errno": 5, "event": "read_aio", "immediately": false= , "once": true, "state": 3}, {"errno": 5, "event": "read_aio", "immediately= ": false, "once": true, "state": 4}], "set-state": [{"event": "flush_to_dis= k", "new-state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "sta= te": 2}, {"event": "read_aio", "new-state": 4, "state": 3}]}, "node-name": = "drive0"}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": {} +} + +--- Reference mirror #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_0", "sync": "full", "target"= : "ref_target_0"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_0"}} +{"return": {}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Add Bitmap --- + +{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, = "name": "bitmap0", "node": "drive0"}} +{"return": {}} + +--- Write #1 --- + +write -P0x65 0x0000000 0x10000 +{"return": ""} +write -P0x77 0x00f8000 0x10000 +{"return": ""} +write -P0x72 0x2008000 0x10000 +{"return": ""} +write -P0x69 0x3fe0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_1", "sync": "full", "target"= : "ref_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_1"}} +{"return": {}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +{"return": ""} + +--- Test mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "mirror-top", "job-id": "mirror_1", "sync": "bitmap", "target": "mirro= r_target_1"}} +{"return": {}} +{"data": {"action": "report", "device": "mirror_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"action": "report", "device": "mirror_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"device": "mirror_1", "error": "Input/output error", "len": 3932= 16, "offset": 65536, "speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_2", "sync": "full", "target"= : "ref_target_2"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_2"}} +{"return": {}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "mirror-top", "job-id": "mirror_2", "sync": "bitmap", "target": "mirro= r_target_2"}} +{"return": {}} +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 262144, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 655360, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "locked" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 10 dirty sectors; have 10. OK! + +=3D Checking Bitmap bitmap0 =3D +expecting 10 dirty sectors; have 10. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 15 dirty sectors; have 15. OK! + +--- Reference mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_3", "sync": "full", "target"= : "ref_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_3"}} +{"return": {}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "mirror-top", "job-id": "mirror_3", "sync": "bitmap", "target": "mirro= r_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"device": "mirror_3", "len": 983040, "offset": 983040, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"id": "mirror_3", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_3", "len": 983040, "offset": 983040, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 15 dirty sectors; have 15. OK! + +--- Cleanup --- + +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} +{"return": {}} +{ + "bitmaps": {} +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fmirror1" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fmirror2" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync3" "TEST_DIR/PID-fmirror3" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fmirror3" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode bitmap; Bitmap Sync never without failure =3D=3D=3D + +--- Preparing image & VM --- + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": {} +} + +--- Reference mirror #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_0", "sync": "full", "target"= : "ref_target_0"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_0"}} +{"return": {}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Add Bitmap --- + +{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, = "name": "bitmap0", "node": "drive0"}} +{"return": {}} + +--- Write #1 --- + +write -P0x65 0x0000000 0x10000 +{"return": ""} +write -P0x77 0x00f8000 0x10000 +{"return": ""} +write -P0x72 0x2008000 0x10000 +{"return": ""} +write -P0x69 0x3fe0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_1", "sync": "full", "target"= : "ref_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_1"}} +{"return": {}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "mirror-top", "job-id": "mirror_1", "sync": "bitmap", "target": "mirro= r_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"id": "mirror_1", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_2", "sync": "full", "target"= : "ref_target_2"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_2"}} +{"return": {}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "mirror-top", "job-id": "mirror_2", "sync": "bitmap", "target": "mirro= r_target_2"}} +{"return": {}} +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 262144, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 655360, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "locked" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 10 dirty sectors; have 10. OK! + +=3D Checking Bitmap bitmap0 =3D +expecting 10 dirty sectors; have 10. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 15 dirty sectors; have 15. OK! + +--- Reference mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_3", "sync": "full", "target"= : "ref_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_3"}} +{"return": {}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "mirror-top", "job-id": "mirror_3", "sync": "bitmap", "target": "mirro= r_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"device": "mirror_3", "len": 983040, "offset": 983040, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"id": "mirror_3", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_3", "len": 983040, "offset": 983040, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 983040, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 15 dirty sectors; have 15. OK! + +--- Cleanup --- + +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} +{"return": {}} +{ + "bitmaps": {} +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fmirror1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fmirror2" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync3" "TEST_DIR/PID-fmirror3" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fmirror3" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode bitmap; Bitmap Sync on-success with simulated failure =3D= =3D=3D + +--- Preparing image & VM --- + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": {} +} + +--- Reference mirror #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_0", "sync": "full", "target"= : "ref_target_0"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_0"}} +{"return": {}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Add Bitmap --- + +{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, = "name": "bitmap0", "node": "drive0"}} +{"return": {}} + +--- Write #1 --- + +write -P0x65 0x0000000 0x10000 +{"return": ""} +write -P0x77 0x00f8000 0x10000 +{"return": ""} +write -P0x72 0x2008000 0x10000 +{"return": ""} +write -P0x69 0x3fe0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_1", "sync": "full", "target"= : "ref_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_1"}} +{"return": {}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "mirror-top", "job-id": "mirror_1", "sync": "bitmap", "target": "= mirror_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-cancel", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"id": "mirror_1", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_2", "sync": "full", "target"= : "ref_target_2"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_2"}} +{"return": {}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "mirror-top", "job-id": "mirror_2", "sync": "bitmap", "target": "= mirror_target_2"}} +{"return": {}} +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 262144, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 655360, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "locked" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 10 dirty sectors; have 10. OK! + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 524288, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 8 dirty sectors; have 8. OK! + +--- Reference mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_3", "sync": "full", "target"= : "ref_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_3"}} +{"return": {}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "mirror-top", "job-id": "mirror_3", "sync": "bitmap", "target": "= mirror_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"id": "mirror_3", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Cleanup --- + +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} +{"return": {}} +{ + "bitmaps": {} +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fmirror1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fmirror2" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync3" "TEST_DIR/PID-fmirror3" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fmirror3" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode bitmap; Bitmap Sync on-success with intermediate failure = =3D=3D=3D + +--- Preparing image & VM --- + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "blkdebug", "image": {"driver": "file", "filename": "TEST_DIR/PID-img= "}, "inject-error": [{"errno": 5, "event": "read_aio", "immediately": false= , "once": true, "state": 3}, {"errno": 5, "event": "read_aio", "immediately= ": false, "once": true, "state": 4}], "set-state": [{"event": "flush_to_dis= k", "new-state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "sta= te": 2}, {"event": "read_aio", "new-state": 4, "state": 3}]}, "node-name": = "drive0"}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": {} +} + +--- Reference mirror #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_0", "sync": "full", "target"= : "ref_target_0"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_0"}} +{"return": {}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Add Bitmap --- + +{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, = "name": "bitmap0", "node": "drive0"}} +{"return": {}} + +--- Write #1 --- + +write -P0x65 0x0000000 0x10000 +{"return": ""} +write -P0x77 0x00f8000 0x10000 +{"return": ""} +write -P0x72 0x2008000 0x10000 +{"return": ""} +write -P0x69 0x3fe0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_1", "sync": "full", "target"= : "ref_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_1"}} +{"return": {}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +{"return": ""} + +--- Test mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "mirror-top", "job-id": "mirror_1", "sync": "bitmap", "target": "= mirror_target_1"}} +{"return": {}} +{"data": {"action": "report", "device": "mirror_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"action": "report", "device": "mirror_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"device": "mirror_1", "error": "Input/output error", "len": 3932= 16, "offset": 65536, "speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_2", "sync": "full", "target"= : "ref_target_2"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_2"}} +{"return": {}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "mirror-top", "job-id": "mirror_2", "sync": "bitmap", "target": "= mirror_target_2"}} +{"return": {}} +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 262144, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 655360, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "locked" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 10 dirty sectors; have 10. OK! + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 524288, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 8 dirty sectors; have 8. OK! + +--- Reference mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_3", "sync": "full", "target"= : "ref_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_3"}} +{"return": {}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "mirror-top", "job-id": "mirror_3", "sync": "bitmap", "target": "= mirror_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"id": "mirror_3", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Cleanup --- + +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} +{"return": {}} +{ + "bitmaps": {} +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fmirror1" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fmirror2" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync3" "TEST_DIR/PID-fmirror3" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fmirror3" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode bitmap; Bitmap Sync on-success without failure =3D=3D=3D + +--- Preparing image & VM --- + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": {} +} + +--- Reference mirror #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_0", "sync": "full", "target"= : "ref_target_0"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_0"}} +{"return": {}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Add Bitmap --- + +{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, = "name": "bitmap0", "node": "drive0"}} +{"return": {}} + +--- Write #1 --- + +write -P0x65 0x0000000 0x10000 +{"return": ""} +write -P0x77 0x00f8000 0x10000 +{"return": ""} +write -P0x72 0x2008000 0x10000 +{"return": ""} +write -P0x69 0x3fe0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_1", "sync": "full", "target"= : "ref_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_1"}} +{"return": {}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "mirror-top", "job-id": "mirror_1", "sync": "bitmap", "target": "= mirror_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"id": "mirror_1", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Reference mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_2", "sync": "full", "target"= : "ref_target_2"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_2"}} +{"return": {}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "mirror-top", "job-id": "mirror_2", "sync": "bitmap", "target": "= mirror_target_2"}} +{"return": {}} +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 458752, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "locked" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 7 dirty sectors; have 7. OK! + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 524288, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 8 dirty sectors; have 8. OK! + +--- Reference mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_3", "sync": "full", "target"= : "ref_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_3"}} +{"return": {}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "mirror-top", "job-id": "mirror_3", "sync": "bitmap", "target": "= mirror_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"id": "mirror_3", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Cleanup --- + +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} +{"return": {}} +{ + "bitmaps": {} +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fmirror1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fmirror2" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync3" "TEST_DIR/PID-fmirror3" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fmirror3" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode bitmap; Bitmap Sync always with simulated failure =3D=3D=3D + +--- Preparing image & VM --- + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": {} +} + +--- Reference mirror #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_0", "sync": "full", "target"= : "ref_target_0"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_0"}} +{"return": {}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Add Bitmap --- + +{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, = "name": "bitmap0", "node": "drive0"}} +{"return": {}} + +--- Write #1 --- + +write -P0x65 0x0000000 0x10000 +{"return": ""} +write -P0x77 0x00f8000 0x10000 +{"return": ""} +write -P0x72 0x2008000 0x10000 +{"return": ""} +write -P0x69 0x3fe0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_1", "sync": "full", "target"= : "ref_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_1"}} +{"return": {}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "mirror-top", "job-id": "mirror_1", "sync": "bitmap", "target": "mirr= or_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-cancel", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"id": "mirror_1", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Reference mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_2", "sync": "full", "target"= : "ref_target_2"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_2"}} +{"return": {}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "mirror-top", "job-id": "mirror_2", "sync": "bitmap", "target": "mirr= or_target_2"}} +{"return": {}} +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 458752, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "locked" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 7 dirty sectors; have 7. OK! + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 524288, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 8 dirty sectors; have 8. OK! + +--- Reference mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_3", "sync": "full", "target"= : "ref_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_3"}} +{"return": {}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "mirror-top", "job-id": "mirror_3", "sync": "bitmap", "target": "mirr= or_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"id": "mirror_3", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Cleanup --- + +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} +{"return": {}} +{ + "bitmaps": {} +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fmirror1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fmirror2" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync3" "TEST_DIR/PID-fmirror3" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fmirror3" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode bitmap; Bitmap Sync always with intermediate failure =3D=3D= =3D + +--- Preparing image & VM --- + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "blkdebug", "image": {"driver": "file", "filename": "TEST_DIR/PID-img= "}, "inject-error": [{"errno": 5, "event": "read_aio", "immediately": false= , "once": true, "state": 3}, {"errno": 5, "event": "read_aio", "immediately= ": false, "once": true, "state": 4}], "set-state": [{"event": "flush_to_dis= k", "new-state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "sta= te": 2}, {"event": "read_aio", "new-state": 4, "state": 3}]}, "node-name": = "drive0"}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": {} +} + +--- Reference mirror #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_0", "sync": "full", "target"= : "ref_target_0"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_0"}} +{"return": {}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Add Bitmap --- + +{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, = "name": "bitmap0", "node": "drive0"}} +{"return": {}} + +--- Write #1 --- + +write -P0x65 0x0000000 0x10000 +{"return": ""} +write -P0x77 0x00f8000 0x10000 +{"return": ""} +write -P0x72 0x2008000 0x10000 +{"return": ""} +write -P0x69 0x3fe0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_1", "sync": "full", "target"= : "ref_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_1"}} +{"return": {}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +{"return": ""} + +--- Test mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "mirror-top", "job-id": "mirror_1", "sync": "bitmap", "target": "mirr= or_target_1"}} +{"return": {}} +{"data": {"action": "report", "device": "mirror_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"action": "report", "device": "mirror_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"device": "mirror_1", "error": "Input/output error", "len": 3932= 16, "offset": 65536, "speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 327680, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 5 dirty sectors; have 5. OK! + +--- Reference mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_2", "sync": "full", "target"= : "ref_target_2"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_2"}} +{"return": {}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "mirror-top", "job-id": "mirror_2", "sync": "bitmap", "target": "mirr= or_target_2"}} +{"return": {}} +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 262144, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 589824, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "locked" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 9 dirty sectors; have 9. OK! + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 524288, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 8 dirty sectors; have 8. OK! + +--- Reference mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_3", "sync": "full", "target"= : "ref_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_3"}} +{"return": {}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "mirror-top", "job-id": "mirror_3", "sync": "bitmap", "target": "mirr= or_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"id": "mirror_3", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Cleanup --- + +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} +{"return": {}} +{ + "bitmaps": {} +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fmirror1" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fmirror2" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync3" "TEST_DIR/PID-fmirror3" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fmirror3" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode bitmap; Bitmap Sync always without failure =3D=3D=3D + +--- Preparing image & VM --- + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": {} +} + +--- Reference mirror #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_0", "sync": "full", "target"= : "ref_target_0"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_0"}} +{"return": {}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Add Bitmap --- + +{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, = "name": "bitmap0", "node": "drive0"}} +{"return": {}} + +--- Write #1 --- + +write -P0x65 0x0000000 0x10000 +{"return": ""} +write -P0x77 0x00f8000 0x10000 +{"return": ""} +write -P0x72 0x2008000 0x10000 +{"return": ""} +write -P0x69 0x3fe0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +--- Reference mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_1", "sync": "full", "target"= : "ref_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_1"}} +{"return": {}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "mirror-top", "job-id": "mirror_1", "sync": "bitmap", "target": "mirr= or_target_1"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_1"}} +{"return": {}} +{"data": {"id": "mirror_1", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Reference mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_2", "sync": "full", "target"= : "ref_target_2"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_2"}} +{"return": {}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "mirror-top", "job-id": "mirror_2", "sync": "bitmap", "target": "mirr= or_target_2"}} +{"return": {}} +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 458752, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "locked" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 7 dirty sectors; have 7. OK! + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 524288, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 8 dirty sectors; have 8. OK! + +--- Reference mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "ref_mirror_3", "sync": "full", "target"= : "ref_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "ref_mirror_3"}} +{"return": {}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "ref_mirror_3", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test mirror #3 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-mirror", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "mirror-top", "job-id": "mirror_3", "sync": "bitmap", "target": "mirr= or_target_3"}} +{"return": {}} +{"execute": "job-complete", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} +{"execute": "job-finalize", "arguments": {"id": "mirror_3"}} +{"return": {}} +{"data": {"id": "mirror_3", "type": "mirror"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "mirror_3", "len": 524288, "offset": 524288, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "drive0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 0 dirty sectors; have 0. OK! + +--- Cleanup --- + +{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} +{"return": {}} +{ + "bitmaps": {} +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fmirror1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fmirror2" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync3" "TEST_DIR/PID-fmirror3" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fmirror3" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D API failure tests =3D=3D=3D + +--- Preparing image & VM --- + +{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"dri= ver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}} +{"return": {}} + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} + +{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, = "name": "bitmap0", "node": "drive0"}} +{"return": {}} + +-- Testing invalid QMP commands -- + +-- Sync mode incremental tests -- + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", = "sync": "incremental", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Must provide a valid bitmap n= ame for 'incremental' sync mode"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "syn= c": "incremental", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Must provide a valid bitmap n= ame for 'incremental' sync mode"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync= ": "incremental", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Must provide a valid bitmap n= ame for 'incremental' sync mode"}} + +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "api_job", "sync": "incremental", "targe= t": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Must provide a valid bitmap n= ame for 'incremental' sync mode"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "filter-node-name": "mirror-top"= , "job-id": "api_job", "sync": "incremental", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Dirty bitmap 'bitmap404' not = found"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "filter-node-name": "mirror-top", "j= ob-id": "api_job", "sync": "incremental", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "filter-node-name": "mirror-top", "jo= b-id": "api_job", "sync": "incremental", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync"= : "incremental", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Dirty bitmap 'bitmap404' not = found"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "always", "device": "drive0", "filter-node-name": "mirror-top", "job= -id": "api_job", "sync": "incremental", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "filter-node-name": "mirror-top", "job-= id": "api_job", "sync": "incremental", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} + +-- Sync mode bitmap tests -- + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", = "sync": "bitmap", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Must provide a valid bitmap n= ame for 'bitmap' sync mode"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "syn= c": "bitmap", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Must provide a valid bitmap n= ame for 'bitmap' sync mode"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync= ": "bitmap", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Must provide a valid bitmap n= ame for 'bitmap' sync mode"}} + +{"execute": "blockdev-mirror", "arguments": {"device": "drive0", "filter-n= ode-name": "mirror-top", "job-id": "api_job", "sync": "bitmap", "target": "= mirror_target"}} +{"error": {"class": "GenericError", "desc": "Must provide a valid bitmap n= ame for 'bitmap' sync mode"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "filter-node-name": "mirror-top"= , "job-id": "api_job", "sync": "bitmap", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Dirty bitmap 'bitmap404' not = found"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "filter-node-name": "mirror-top", "j= ob-id": "api_job", "sync": "bitmap", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Dirty bitmap 'bitmap404' not = found"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "filter-node-name": "mirror-top", "jo= b-id": "api_job", "sync": "bitmap", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Dirty bitmap 'bitmap404' not = found"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync"= : "bitmap", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "bitmap-mode must be specified= if a bitmap is provided"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync": = "bitmap", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "bitmap-mode must be specified= if a bitmap is provided"}} + +-- Sync mode full tests -- + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", = "sync": "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "syn= c": "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync= ": "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "filter-node-name": "mirror-top"= , "job-id": "api_job", "sync": "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "filter-node-name": "mirror-top", "j= ob-id": "api_job", "sync": "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "filter-node-name": "mirror-top", "jo= b-id": "api_job", "sync": "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync"= : "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "on-success", "device": "drive0", "filter-node-name": "mirror-top", = "job-id": "api_job", "sync": "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "always", "device": "drive0", "filter-node-name": "mirror-top", "job= -id": "api_job", "sync": "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "filter-node-name": "mirror-top", "job-= id": "api_job", "sync": "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync": = "full", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +-- Sync mode top tests -- + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", = "sync": "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "syn= c": "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync= ": "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "filter-node-name": "mirror-top"= , "job-id": "api_job", "sync": "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "filter-node-name": "mirror-top", "j= ob-id": "api_job", "sync": "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "filter-node-name": "mirror-top", "jo= b-id": "api_job", "sync": "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync"= : "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "on-success", "device": "drive0", "filter-node-name": "mirror-top", = "job-id": "api_job", "sync": "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "always", "device": "drive0", "filter-node-name": "mirror-top", "job= -id": "api_job", "sync": "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "filter-node-name": "mirror-top", "job-= id": "api_job", "sync": "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync": = "top", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'full' not supporte= d with bitmap."}} + +-- Sync mode none tests -- + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", = "sync": "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "syn= c": "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync= ": "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "filter-node-name": "mirror-top"= , "job-id": "api_job", "sync": "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'none' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "filter-node-name": "mirror-top", "j= ob-id": "api_job", "sync": "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'none' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "filter-node-name": "mirror-top", "jo= b-id": "api_job", "sync": "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'none' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync"= : "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'none' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "on-success", "device": "drive0", "filter-node-name": "mirror-top", = "job-id": "api_job", "sync": "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'none' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "always", "device": "drive0", "filter-node-name": "mirror-top", "job= -id": "api_job", "sync": "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'none' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "filter-node-name": "mirror-top", "job-= id": "api_job", "sync": "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'none' not supporte= d with bitmap."}} + +{"execute": "blockdev-mirror", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "filter-node-name": "mirror-top", "job-id": "api_job", "sync": = "none", "target": "mirror_target"}} +{"error": {"class": "GenericError", "desc": "Sync mode 'none' not supporte= d with bitmap."}} + diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index ff59cfd2d4..6dba0ac348 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -314,3 +314,4 @@ 303 rw quick 304 rw quick 305 rw quick +306 rw --=20 2.20.1