From nobody Tue May 21 07:37:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562721109; cv=none; d=zoho.com; s=zohoarc; b=B6h6blJwnBp3kJkVin7lFtpqO0ewxrlzgyIudm10NCG43p+f/WcXvao0Ybjr9zzkPA3KsUx5ysMcfqv5NaIhBoXq4CG77IwbNiUvxu9OSLuA4VElT8xLa2ZsK+gC2t9t/vtJluw6m24kM+jM8n3Lz5CR9J4ipzfK5IcZ9Mi6ZqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562721109; h=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:ARC-Authentication-Results; bh=LRoxOtuUznk4uZe0WQc1JEHrUducEVkgd68YVWQ5RXk=; b=olfv70WscNLpauJ+iylAh+zmQkGPMn/i0Tf6YEc38pISVil/Ne/XImI7NzsJUSVzpBnVZtUUMx3BuhOzLoj55QCdvgB3lju2bOrS6pNsDhbfjZwgA4VCo/nyFjSMP42DUEANwu8AMgrmWIxn22XrPaSHNU8PiJBXOT+oAYic1lU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562721109362489.74232391198075; Tue, 9 Jul 2019 18:11:49 -0700 (PDT) Received: from localhost ([::1]:57354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl198-0004cc-Rx for importer@patchew.org; Tue, 09 Jul 2019 21:11:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48911) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl13j-0000HL-6v for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl13h-0004KL-2i for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58800) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hl13Z-0004EC-J1; Tue, 09 Jul 2019 21:06:03 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 79713D6F02; Wed, 10 Jul 2019 01:06:00 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFFDB1001B1B; Wed, 10 Jul 2019 01:05:59 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 9 Jul 2019 21:05:49 -0400 Message-Id: <20190710010556.32365-2-jsnow@redhat.com> In-Reply-To: <20190710010556.32365-1-jsnow@redhat.com> References: <20190710010556.32365-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 10 Jul 2019 01:06:00 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/8] iotests/257: add Pattern class 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 , John Snow , Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Just kidding, this is easier to manage with a full class instead of a namedtuple. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/257 | 58 +++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index 75a651c7c3..f576a35a5c 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -19,7 +19,6 @@ # # owner=3Djsnow@redhat.com =20 -from collections import namedtuple import math import os =20 @@ -29,10 +28,18 @@ from iotests import log, qemu_img SIZE =3D 64 * 1024 * 1024 GRANULARITY =3D 64 * 1024 =20 -Pattern =3D namedtuple('Pattern', ['byte', 'offset', 'size']) -def mkpattern(byte, offset, size=3DGRANULARITY): - """Constructor for Pattern() with default size""" - return Pattern(byte, offset, size) + +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 math.floor(self.offset / granularity) + upper =3D math.floor((self.offset + self.size - 1) / granularity) + return set(range(lower, upper + 1)) + =20 class PatternGroup: """Grouping of Pattern objects. Initialize with an iterable of Pattern= s.""" @@ -43,40 +50,39 @@ class PatternGroup: """Calculate the unique bits dirtied by this pattern grouping""" res =3D set() for pattern in self.patterns: - lower =3D math.floor(pattern.offset / granularity) - upper =3D math.floor((pattern.offset + pattern.size - 1) / gra= nularity) - res =3D res | set(range(lower, upper + 1)) + res =3D res | pattern.bits(granularity) return res =20 + GROUPS =3D [ PatternGroup([ # Batch 0: 4 clusters - mkpattern('0x49', 0x0000000), - mkpattern('0x6c', 0x0100000), # 1M - mkpattern('0x6f', 0x2000000), # 32M - mkpattern('0x76', 0x3ff0000)]), # 64M - 64K + Pattern('0x49', 0x0000000), + Pattern('0x6c', 0x0100000), # 1M + Pattern('0x6f', 0x2000000), # 32M + Pattern('0x76', 0x3ff0000)]), # 64M - 64K PatternGroup([ # Batch 1: 6 clusters (3 new) - mkpattern('0x65', 0x0000000), # Full overwrite - mkpattern('0x77', 0x00f8000), # Partial-left (1M-32K) - mkpattern('0x72', 0x2008000), # Partial-right (32M+32K) - mkpattern('0x69', 0x3fe0000)]), # Adjacent-left (64M - 128K) + 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) - mkpattern('0x74', 0x0010000), # Adjacent-right - mkpattern('0x69', 0x00e8000), # Partial-left (1M-96K) - mkpattern('0x6e', 0x2018000), # Partial-right (32M+96K) - mkpattern('0x67', 0x3fe0000, - 2*GRANULARITY)]), # Overwrite [(64M-128K)-64M) + 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. - mkpattern('0xaa', 0x0010000, - 3*GRANULARITY), # Overwrite and 2x Adjacent-right - mkpattern('0xbb', 0x00d8000), # Partial-left (1M-160K) - mkpattern('0xcc', 0x2028000), # Partial-right (32M+160K) - mkpattern('0xdd', 0x3fc0000)]), # New; leaving a gap to the right + 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 ] =20 class Drive: --=20 2.21.0 From nobody Tue May 21 07:37:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562721463; cv=none; d=zoho.com; s=zohoarc; b=M1qxZ8vos3fiY1byMrrjoF6SlEP70nUckkj2+9+P8XXDo2YLtqfCclHLDbleeXMFF2dxWF10orqFJJ6VSVSlU6DSotTO4ysVPbPH+4sJcnT8U14jedtUlMh4zQN3cedxlFQQftw7pRepiEhzsY6+kPo7BZ4lZAVfHlsL+50qEBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562721463; h=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:ARC-Authentication-Results; bh=l6BnFEBtpNOXO0ugAlGaxRi7G9SzQBD49eCFlDS43WI=; b=bRVc12pSjCSRGatjFCoKrMxQpLbw4lv3U0Lv071Hiwk+2IOTvIndic3xa8VmU45zXrdeQwG+b5UrAjS1u/92bGOUNvjbSC1KAvzLWUXcuUmvZ07ilpI1u8SeG6KXUDSAs+tzHgwKoU9AVnUYAN2EeQL40GUN0hLMEVj7ireiy+o= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562721463837510.18674340003975; Tue, 9 Jul 2019 18:17:43 -0700 (PDT) Received: from localhost ([::1]:57370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl1Em-0006l7-TY for importer@patchew.org; Tue, 09 Jul 2019 21:17:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48966) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl13l-0000Ju-LG for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl13j-0004Mr-6s for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49666) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hl13b-0004El-7v; Tue, 09 Jul 2019 21:06:03 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 621BB8535C; Wed, 10 Jul 2019 01:06:01 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 998991001B1B; Wed, 10 Jul 2019 01:06:00 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 9 Jul 2019 21:05:50 -0400 Message-Id: <20190710010556.32365-3-jsnow@redhat.com> In-Reply-To: <20190710010556.32365-1-jsnow@redhat.com> References: <20190710010556.32365-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 10 Jul 2019 01:06:01 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/8] iotests/257: add EmulatedBitmap class 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 , John Snow , Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Represent a bitmap with an object that we can mark and clear bits in. This makes it easier to manage partial writes when we don't write a full group's worth of patterns before an error. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/257 | 125 +++++++++++++++++++++++++---------------- 1 file changed, 76 insertions(+), 49 deletions(-) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index f576a35a5c..2ff4aa8695 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -85,6 +85,60 @@ GROUPS =3D [ Pattern('0xdd', 0x3fc0000)]), # New; leaving a gap to the right ] =20 + +class EmulatedBitmap: + def __init__(self, granularity=3DGRANULARITY): + self._bits =3D set() + self.groups =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 self._bits - 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.""" @@ -195,27 +249,6 @@ def perform_writes(drive, n): log('') return bitmaps =20 -def calculate_bits(groups=3DNone): - """Calculate how many bits we expect to see dirtied.""" - if groups: - bits =3D set.union(*(GROUPS[group].bits(GRANULARITY) for group in = groups)) - return len(bits) - return 0 - -def bitmap_comparison(bitmap, groups=3DNone, want=3D0): - """ - Print a nice human-readable message checking that this bitmap has as - many bits set as we expect it to. - """ - log("=3D Checking Bitmap {:s} =3D".format(bitmap.get('name', '(anonymo= us)'))) - - if groups: - want =3D calculate_bits(groups) - have =3D bitmap['count'] // bitmap['granularity'] - - log("expecting {:d} dirty sectors; have {:d}. {:s}".format( - want, have, "OK!" if want =3D=3D have else "ERROR!")) - log('') =20 def compare_images(image, reference, baseimg=3DNone, expected_match=3DTrue= ): """ @@ -321,12 +354,13 @@ def test_bitmap_sync(bsync_mode, failure=3DNone): vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.name, name=3D"bitmap0", granularity=3DGRANULARITY) log('') + ebitmap =3D EmulatedBitmap() =20 # 1 - Writes and Reference Backup bitmaps =3D perform_writes(drive0, 1) - dirty_groups =3D {1} + ebitmap.dirty_group(1) bitmap =3D get_bitmap(bitmaps, drive0.device, 'bitmap0') - bitmap_comparison(bitmap, groups=3Ddirty_groups) + ebitmap.compare(bitmap) reference_backup(drive0, 1, fbackup1) =20 # 1 - Bitmap Backup (Optional induced failure) @@ -342,54 +376,47 @@ def test_bitmap_sync(bsync_mode, failure=3DNone): log('') bitmaps =3D perform_writes(drive0, 2) # Named bitmap (static, should be unchanged) - bitmap_comparison(get_bitmap(bitmaps, drive0.device, 'bitmap0'= ), - groups=3Ddirty_groups) + ebitmap.compare(get_bitmap(bitmaps, drive0.device, 'bitmap0')) # Anonymous bitmap (dynamic, shows new writes) - bitmap_comparison(get_bitmap(bitmaps, drive0.device, '', - recording=3DTrue), groups=3D{2}) - dirty_groups.add(2) + anonymous =3D EmulatedBitmap() + anonymous.dirty_group(2) + anonymous.compare(get_bitmap(bitmaps, drive0.device, '', + recording=3DTrue)) + + # Simulate the order in which this will happen: + # group 1 gets cleared first, then group two gets written. + if ((bsync_mode =3D=3D 'on-success' and not failure) or + (bsync_mode =3D=3D 'always')): + ebitmap.clear_group(1) + ebitmap.dirty_group(2) =20 vm.run_job(job, auto_dismiss=3DTrue, auto_finalize=3DFalse, pre_finalize=3D_callback, cancel=3D(failure =3D=3D 'simulated')) bitmaps =3D query_bitmaps(vm) - bitmap =3D get_bitmap(bitmaps, drive0.device, 'bitmap0') log(bitmaps, indent=3D2) log('') =20 - if ((bsync_mode =3D=3D 'on-success' and not failure) or - (bsync_mode =3D=3D 'always' and failure !=3D 'intermediate= ')): - dirty_groups.remove(1) - if bsync_mode =3D=3D 'always' and failure =3D=3D 'intermediate': # We manage to copy one sector (one bit) before the error. - bitmap_comparison(bitmap, - want=3Dcalculate_bits(groups=3Ddirty_groups)= - 1) - else: - bitmap_comparison(bitmap, groups=3Ddirty_groups) + ebitmap.clear_bit(ebitmap.first_bit) + ebitmap.compare(get_bitmap(bitmaps, drive0.device, 'bitmap0')) =20 # 2 - Writes and Reference Backup bitmaps =3D perform_writes(drive0, 3) - dirty_groups.add(3) - bitmap =3D get_bitmap(bitmaps, drive0.device, 'bitmap0') - if bsync_mode =3D=3D 'always' and failure =3D=3D 'intermediate': - # We're one bit short, still. - bitmap_comparison(bitmap, - want=3Dcalculate_bits(groups=3Ddirty_groups)= - 1) - else: - bitmap_comparison(bitmap, groups=3Ddirty_groups) + ebitmap.dirty_group(3) + ebitmap.compare(get_bitmap(bitmaps, drive0.device, 'bitmap0')) reference_backup(drive0, 2, fbackup2) =20 # 2 - Bitmap Backup (In failure modes, this is a recovery.) job =3D bitmap_backup(drive0, 2, bsync2, "bitmap0", bsync_mode) vm.run_job(job, auto_dismiss=3DTrue, auto_finalize=3DFalse) bitmaps =3D query_bitmaps(vm) - bitmap =3D get_bitmap(bitmaps, drive0.device, 'bitmap0') log(bitmaps, indent=3D2) log('') - bitmap_comparison(bitmap, groups=3D{} - if bsync_mode !=3D 'never' - else dirty_groups) + if bsync_mode !=3D 'never': + ebitmap.clear() + ebitmap.compare(get_bitmap(bitmaps, drive0.device, 'bitmap0')) =20 log('--- Cleanup ---\n') vm.qmp_log("block-dirty-bitmap-remove", --=20 2.21.0 From nobody Tue May 21 07:37:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562721751; cv=none; d=zoho.com; s=zohoarc; b=FJxV05FQesQNL89d0bW/wsM9cNgq4kOYsTLE5Ld5OjNlu9MfwdZy8kwp0PXCXa60CIBBoZPljO0DYyMeZAeHEK8a1+v39IwFnD7ky/ksZFLdh7K70aaxVH/fKwS8A9bhwLEzTDx7hlNQf014fAL0ltpX8p7d0Hv/mPKZQRCQ+d4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562721751; h=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:ARC-Authentication-Results; bh=0O0vxNq71ovrZHIamtNtEyA+tSABR4KqB/ZCndQJ4AI=; b=CJ30D7YqBJ6vGXBEFjNkiSWzNmtIHcjYXMN3a8n7jT7rzCAhkK2+wG4XpQ+jFpmpq/Abyfk+cxJK1Ih9j7GzNgWDTd1eRYtChTraUDaFruJ9ZPibM2mCsMQ+NuHfBYVGIgUAQlbEHI/OjoovuUvSkL+9H75c+Wl1p0PQx8oP2HQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562721751217304.1023505635902; Tue, 9 Jul 2019 18:22:31 -0700 (PDT) Received: from localhost ([::1]:57412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl1JW-0001PW-4c for importer@patchew.org; Tue, 09 Jul 2019 21:22:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49361) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl13x-0000YY-N7 for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl13q-0004cm-JN for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38542) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hl13b-0004F4-7f; Tue, 09 Jul 2019 21:06:05 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 59D2681111; Wed, 10 Jul 2019 01:06:02 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82ECA1001B19; Wed, 10 Jul 2019 01:06:01 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 9 Jul 2019 21:05:51 -0400 Message-Id: <20190710010556.32365-4-jsnow@redhat.com> In-Reply-To: <20190710010556.32365-1-jsnow@redhat.com> References: <20190710010556.32365-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 10 Jul 2019 01:06:02 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/8] iotests/257: Refactor backup helpers 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 , John Snow , Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This test needs support for non-bitmap backups and missing or unspecified bitmap sync modes, so rewrite the helpers to be a little more generic. Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/257 | 46 +++++---- tests/qemu-iotests/257.out | 192 ++++++++++++++++++------------------- 2 files changed, 124 insertions(+), 114 deletions(-) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index 2ff4aa8695..2eb4f26c28 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -208,6 +208,14 @@ def get_bitmap(bitmaps, drivename, name, recording=3DN= one): return bitmap return None =20 +def blockdev_backup(vm, device, target, sync, **kwargs): + result =3D vm.qmp_log('blockdev-backup', + device=3Ddevice, + target=3Dtarget, + sync=3Dsync, + **kwargs) + return result + def reference_backup(drive, n, filepath): log("--- Reference Backup #{:d} ---\n".format(n)) target_id =3D "ref_target_{:d}".format(n) @@ -215,24 +223,26 @@ def reference_backup(drive, n, filepath): target_drive =3D Drive(filepath, vm=3Ddrive.vm) =20 target_drive.create_target(target_id, drive.fmt, drive.size) - drive.vm.qmp_log("blockdev-backup", - job_id=3Djob_id, device=3Ddrive.name, - target=3Dtarget_id, sync=3D"full") + blockdev_backup(drive.vm, drive.name, target_id, "full", job_id=3Djob_= id) drive.vm.run_job(job_id, auto_dismiss=3DTrue) log('') =20 -def bitmap_backup(drive, n, filepath, bitmap, bitmap_mode): - log("--- Bitmap Backup #{:d} ---\n".format(n)) - target_id =3D "bitmap_target_{:d}".format(n) - job_id =3D "bitmap_backup_{:d}".format(n) +def backup(drive, n, filepath, bitmap, bitmap_mode, sync=3D'bitmap'): + log("--- Test Backup #{:d} ---\n".format(n)) + target_id =3D "backup_target_{:d}".format(n) + job_id =3D "backup_{:d}".format(n) target_drive =3D Drive(filepath, vm=3Ddrive.vm) =20 target_drive.create_target(target_id, drive.fmt, drive.size) - drive.vm.qmp_log("blockdev-backup", job_id=3Djob_id, device=3Ddrive.na= me, - target=3Dtarget_id, sync=3D"bitmap", - bitmap_mode=3Dbitmap_mode, - bitmap=3Dbitmap, - auto_finalize=3DFalse) + + kwargs =3D { + 'job_id': job_id, + 'auto_finalize': False, + 'bitmap': bitmap, + 'bitmap_mode': bitmap_mode, + } + kwargs =3D {key: val for key, val in kwargs.items() if val is not None} + blockdev_backup(drive.vm, drive.name, target_id, sync, **kwargs) return job_id =20 def perform_writes(drive, n): @@ -264,7 +274,7 @@ def compare_images(image, reference, baseimg=3DNone, ex= pected_match=3DTrue): "OK!" if ret =3D=3D expected_ret else "ERROR!"), filters=3D[iotests.filter_testfiles]) =20 -def test_bitmap_sync(bsync_mode, failure=3DNone): +def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap', failure=3DNone): """ Test bitmap backup routines. =20 @@ -292,7 +302,7 @@ def test_bitmap_sync(bsync_mode, failure=3DNone): fbackup0, fbackup1, fbackup2), \ iotests.VM() as vm: =20 - mode =3D "Bitmap Sync Mode {:s}".format(bsync_mode) + 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 @@ -363,12 +373,12 @@ def test_bitmap_sync(bsync_mode, failure=3DNone): ebitmap.compare(bitmap) reference_backup(drive0, 1, fbackup1) =20 - # 1 - Bitmap Backup (Optional induced failure) + # 1 - Test Backup (w/ Optional induced failure) if failure =3D=3D 'intermediate': # Activate blkdebug induced failure for second-to-next read log(vm.hmp_qemu_io(drive0.name, 'flush')) log('') - job =3D bitmap_backup(drive0, 1, bsync1, "bitmap0", bsync_mode) + job =3D backup(drive0, 1, bsync1, "bitmap0", bsync_mode, sync=3Dms= ync_mode) =20 def _callback(): """Issue writes while the job is open to test bitmap divergenc= e.""" @@ -409,7 +419,7 @@ def test_bitmap_sync(bsync_mode, failure=3DNone): reference_backup(drive0, 2, fbackup2) =20 # 2 - Bitmap Backup (In failure modes, this is a recovery.) - job =3D bitmap_backup(drive0, 2, bsync2, "bitmap0", bsync_mode) + job =3D backup(drive0, 2, bsync2, "bitmap0", bsync_mode) vm.run_job(job, auto_dismiss=3DTrue, auto_finalize=3DFalse) bitmaps =3D query_bitmaps(vm) log(bitmaps, indent=3D2) @@ -443,7 +453,7 @@ def test_bitmap_sync(bsync_mode, failure=3DNone): def main(): for bsync_mode in ("never", "on-success", "always"): for failure in ("simulated", "intermediate", None): - test_bitmap_sync(bsync_mode, failure) + test_bitmap_sync(bsync_mode, "bitmap", failure) =20 if __name__ =3D=3D '__main__': iotests.script_main(main, supported_fmts=3D['qcow2']) diff --git a/tests/qemu-iotests/257.out b/tests/qemu-iotests/257.out index e0775d4815..0abc96acd3 100644 --- a/tests/qemu-iotests/257.out +++ b/tests/qemu-iotests/257.out @@ -1,5 +1,5 @@ =20 -=3D=3D=3D Bitmap Sync Mode never with simulated failure =3D=3D=3D +=3D=3D=3D Mode bitmap; Bitmap Sync never with simulated failure =3D=3D=3D =20 --- Preparing image & VM --- =20 @@ -86,7 +86,7 @@ expecting 6 dirty sectors; have 6. OK! {"return": {}} {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #1 --- +--- Test Backup #1 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -96,7 +96,7 @@ expecting 6 dirty sectors; have 6. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "bitm= ap_backup_1", "sync": "bitmap", "target": "bitmap_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "back= up_1", "sync": "bitmap", "target": "backup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -147,10 +147,10 @@ expecting 6 dirty sectors; have 6. OK! =3D Checking Bitmap (anonymous) =3D expecting 7 dirty sectors; have 7. OK! =20 -{"execute": "job-cancel", "arguments": {"id": "bitmap_backup_1"}} +{"execute": "job-cancel", "arguments": {"id": "backup_1"}} {"return": {}} -{"data": {"id": "bitmap_backup_1", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_1", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -213,7 +213,7 @@ expecting 15 dirty sectors; have 15. OK! {"return": {}} {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #2 --- +--- Test Backup #2 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -223,12 +223,12 @@ expecting 15 dirty sectors; have 15. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "bitm= ap_backup_2", "sync": "bitmap", "target": "bitmap_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "back= up_2", "sync": "bitmap", "target": "backup_target_2"}} {"return": {}} -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_2"}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} -{"data": {"id": "bitmap_backup_2", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_2", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -265,7 +265,7 @@ qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fb= ackup2" =3D=3D> Identical, OK qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! =20 =20 -=3D=3D=3D Bitmap Sync Mode never with intermediate failure =3D=3D=3D +=3D=3D=3D Mode bitmap; Bitmap Sync never with intermediate failure =3D=3D= =3D =20 --- Preparing image & VM --- =20 @@ -354,7 +354,7 @@ expecting 6 dirty sectors; have 6. OK! =20 {"return": ""} =20 ---- Bitmap Backup #1 --- +--- Test Backup #1 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -364,10 +364,10 @@ expecting 6 dirty sectors; have 6. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "bitm= ap_backup_1", "sync": "bitmap", "target": "bitmap_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "back= up_1", "sync": "bitmap", "target": "backup_target_1"}} {"return": {}} -{"data": {"action": "report", "device": "bitmap_backup_1", "operation": "r= ead"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "= seconds": "SECS"}} -{"data": {"device": "bitmap_backup_1", "error": "Input/output error", "len= ": 67108864, "offset": 66781184, "speed": 0, "type": "backup"}, "event": "B= LOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SEC= S"}} +{"data": {"action": "report", "device": "backup_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"device": "backup_1", "error": "Input/output error", "len": 6710= 8864, "offset": 66781184, "speed": 0, "type": "backup"}, "event": "BLOCK_JO= B_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -430,7 +430,7 @@ expecting 14 dirty sectors; have 14. OK! {"return": {}} {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #2 --- +--- Test Backup #2 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -440,12 +440,12 @@ expecting 14 dirty sectors; have 14. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "bitm= ap_backup_2", "sync": "bitmap", "target": "bitmap_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "back= up_2", "sync": "bitmap", "target": "backup_target_2"}} {"return": {}} -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_2"}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} -{"data": {"id": "bitmap_backup_2", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_2", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -482,7 +482,7 @@ qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fb= ackup2" =3D=3D> Identical, OK qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! =20 =20 -=3D=3D=3D Bitmap Sync Mode never without failure =3D=3D=3D +=3D=3D=3D Mode bitmap; Bitmap Sync never without failure =3D=3D=3D =20 --- Preparing image & VM --- =20 @@ -569,7 +569,7 @@ expecting 6 dirty sectors; have 6. OK! {"return": {}} {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #1 --- +--- Test Backup #1 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -579,7 +579,7 @@ expecting 6 dirty sectors; have 6. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "bitm= ap_backup_1", "sync": "bitmap", "target": "bitmap_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "back= up_1", "sync": "bitmap", "target": "backup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -630,10 +630,10 @@ expecting 6 dirty sectors; have 6. OK! =3D Checking Bitmap (anonymous) =3D expecting 7 dirty sectors; have 7. OK! =20 -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_1"}} +{"execute": "job-finalize", "arguments": {"id": "backup_1"}} {"return": {}} -{"data": {"id": "bitmap_backup_1", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_1", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -696,7 +696,7 @@ expecting 15 dirty sectors; have 15. OK! {"return": {}} {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #2 --- +--- Test Backup #2 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -706,12 +706,12 @@ expecting 15 dirty sectors; have 15. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "bitm= ap_backup_2", "sync": "bitmap", "target": "bitmap_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "back= up_2", "sync": "bitmap", "target": "backup_target_2"}} {"return": {}} -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_2"}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} -{"data": {"id": "bitmap_backup_2", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_2", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -748,7 +748,7 @@ qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fb= ackup2" =3D=3D> Identical, OK qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! =20 =20 -=3D=3D=3D Bitmap Sync Mode on-success with simulated failure =3D=3D=3D +=3D=3D=3D Mode bitmap; Bitmap Sync on-success with simulated failure =3D= =3D=3D =20 --- Preparing image & VM --- =20 @@ -835,7 +835,7 @@ expecting 6 dirty sectors; have 6. OK! {"return": {}} {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #1 --- +--- Test Backup #1 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -845,7 +845,7 @@ expecting 6 dirty sectors; have 6. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "bitmap_backup_1", "sync": "bitmap", "target": "bitmap_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_1", "sync": "bitmap", "target": "backup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -896,10 +896,10 @@ expecting 6 dirty sectors; have 6. OK! =3D Checking Bitmap (anonymous) =3D expecting 7 dirty sectors; have 7. OK! =20 -{"execute": "job-cancel", "arguments": {"id": "bitmap_backup_1"}} +{"execute": "job-cancel", "arguments": {"id": "backup_1"}} {"return": {}} -{"data": {"id": "bitmap_backup_1", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_1", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -962,7 +962,7 @@ expecting 15 dirty sectors; have 15. OK! {"return": {}} {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #2 --- +--- Test Backup #2 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -972,12 +972,12 @@ expecting 15 dirty sectors; have 15. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "bitmap_backup_2", "sync": "bitmap", "target": "bitmap_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} {"return": {}} -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_2"}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} -{"data": {"id": "bitmap_backup_2", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_2", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -1014,7 +1014,7 @@ qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-= fbackup2" =3D=3D> Identical, OK qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! =20 =20 -=3D=3D=3D Bitmap Sync Mode on-success with intermediate failure =3D=3D=3D +=3D=3D=3D Mode bitmap; Bitmap Sync on-success with intermediate failure = =3D=3D=3D =20 --- Preparing image & VM --- =20 @@ -1103,7 +1103,7 @@ expecting 6 dirty sectors; have 6. OK! =20 {"return": ""} =20 ---- Bitmap Backup #1 --- +--- Test Backup #1 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -1113,10 +1113,10 @@ expecting 6 dirty sectors; have 6. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "bitmap_backup_1", "sync": "bitmap", "target": "bitmap_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_1", "sync": "bitmap", "target": "backup_target_1"}} {"return": {}} -{"data": {"action": "report", "device": "bitmap_backup_1", "operation": "r= ead"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "= seconds": "SECS"}} -{"data": {"device": "bitmap_backup_1", "error": "Input/output error", "len= ": 67108864, "offset": 66781184, "speed": 0, "type": "backup"}, "event": "B= LOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SEC= S"}} +{"data": {"action": "report", "device": "backup_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"device": "backup_1", "error": "Input/output error", "len": 6710= 8864, "offset": 66781184, "speed": 0, "type": "backup"}, "event": "BLOCK_JO= B_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -1179,7 +1179,7 @@ expecting 14 dirty sectors; have 14. OK! {"return": {}} {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #2 --- +--- Test Backup #2 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -1189,12 +1189,12 @@ expecting 14 dirty sectors; have 14. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "bitmap_backup_2", "sync": "bitmap", "target": "bitmap_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} {"return": {}} -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_2"}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} -{"data": {"id": "bitmap_backup_2", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_2", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -1231,7 +1231,7 @@ qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-= fbackup2" =3D=3D> Identical, OK qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! =20 =20 -=3D=3D=3D Bitmap Sync Mode on-success without failure =3D=3D=3D +=3D=3D=3D Mode bitmap; Bitmap Sync on-success without failure =3D=3D=3D =20 --- Preparing image & VM --- =20 @@ -1318,7 +1318,7 @@ expecting 6 dirty sectors; have 6. OK! {"return": {}} {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #1 --- +--- Test Backup #1 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -1328,7 +1328,7 @@ expecting 6 dirty sectors; have 6. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "bitmap_backup_1", "sync": "bitmap", "target": "bitmap_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_1", "sync": "bitmap", "target": "backup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -1379,10 +1379,10 @@ expecting 6 dirty sectors; have 6. OK! =3D Checking Bitmap (anonymous) =3D expecting 7 dirty sectors; have 7. OK! =20 -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_1"}} +{"execute": "job-finalize", "arguments": {"id": "backup_1"}} {"return": {}} -{"data": {"id": "bitmap_backup_1", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_1", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -1445,7 +1445,7 @@ expecting 12 dirty sectors; have 12. OK! {"return": {}} {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #2 --- +--- Test Backup #2 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -1455,12 +1455,12 @@ expecting 12 dirty sectors; have 12. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "bitmap_backup_2", "sync": "bitmap", "target": "bitmap_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} {"return": {}} -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_2"}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} -{"data": {"id": "bitmap_backup_2", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_2", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -1497,7 +1497,7 @@ qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-= fbackup2" =3D=3D> Identical, OK qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! =20 =20 -=3D=3D=3D Bitmap Sync Mode always with simulated failure =3D=3D=3D +=3D=3D=3D Mode bitmap; Bitmap Sync always with simulated failure =3D=3D=3D =20 --- Preparing image & VM --- =20 @@ -1584,7 +1584,7 @@ expecting 6 dirty sectors; have 6. OK! {"return": {}} {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #1 --- +--- Test Backup #1 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -1594,7 +1594,7 @@ expecting 6 dirty sectors; have 6. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bit= map_backup_1", "sync": "bitmap", "target": "bitmap_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_1", "sync": "bitmap", "target": "backup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -1645,10 +1645,10 @@ expecting 6 dirty sectors; have 6. OK! =3D Checking Bitmap (anonymous) =3D expecting 7 dirty sectors; have 7. OK! =20 -{"execute": "job-cancel", "arguments": {"id": "bitmap_backup_1"}} +{"execute": "job-cancel", "arguments": {"id": "backup_1"}} {"return": {}} -{"data": {"id": "bitmap_backup_1", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_1", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -1711,7 +1711,7 @@ expecting 12 dirty sectors; have 12. OK! {"return": {}} {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #2 --- +--- Test Backup #2 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -1721,12 +1721,12 @@ expecting 12 dirty sectors; have 12. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bit= map_backup_2", "sync": "bitmap", "target": "bitmap_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} {"return": {}} -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_2"}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} -{"data": {"id": "bitmap_backup_2", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_2", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -1763,7 +1763,7 @@ qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-= fbackup2" =3D=3D> Identical, OK qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! =20 =20 -=3D=3D=3D Bitmap Sync Mode always with intermediate failure =3D=3D=3D +=3D=3D=3D Mode bitmap; Bitmap Sync always with intermediate failure =3D=3D= =3D =20 --- Preparing image & VM --- =20 @@ -1852,7 +1852,7 @@ expecting 6 dirty sectors; have 6. OK! =20 {"return": ""} =20 ---- Bitmap Backup #1 --- +--- Test Backup #1 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -1862,10 +1862,10 @@ expecting 6 dirty sectors; have 6. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bit= map_backup_1", "sync": "bitmap", "target": "bitmap_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_1", "sync": "bitmap", "target": "backup_target_1"}} {"return": {}} -{"data": {"action": "report", "device": "bitmap_backup_1", "operation": "r= ead"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "= seconds": "SECS"}} -{"data": {"device": "bitmap_backup_1", "error": "Input/output error", "len= ": 67108864, "offset": 66781184, "speed": 0, "type": "backup"}, "event": "B= LOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SEC= S"}} +{"data": {"action": "report", "device": "backup_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"device": "backup_1", "error": "Input/output error", "len": 6710= 8864, "offset": 66781184, "speed": 0, "type": "backup"}, "event": "BLOCK_JO= B_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -1928,7 +1928,7 @@ expecting 13 dirty sectors; have 13. OK! {"return": {}} {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #2 --- +--- Test Backup #2 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -1938,12 +1938,12 @@ expecting 13 dirty sectors; have 13. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bit= map_backup_2", "sync": "bitmap", "target": "bitmap_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} {"return": {}} -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_2"}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} -{"data": {"id": "bitmap_backup_2", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_2", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -1980,7 +1980,7 @@ qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-= fbackup2" =3D=3D> Identical, OK qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! =20 =20 -=3D=3D=3D Bitmap Sync Mode always without failure =3D=3D=3D +=3D=3D=3D Mode bitmap; Bitmap Sync always without failure =3D=3D=3D =20 --- Preparing image & VM --- =20 @@ -2067,7 +2067,7 @@ expecting 6 dirty sectors; have 6. OK! {"return": {}} {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #1 --- +--- Test Backup #1 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -2077,7 +2077,7 @@ expecting 6 dirty sectors; have 6. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bit= map_backup_1", "sync": "bitmap", "target": "bitmap_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_1", "sync": "bitmap", "target": "backup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -2128,10 +2128,10 @@ expecting 6 dirty sectors; have 6. OK! =3D Checking Bitmap (anonymous) =3D expecting 7 dirty sectors; have 7. OK! =20 -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_1"}} +{"execute": "job-finalize", "arguments": {"id": "backup_1"}} {"return": {}} -{"data": {"id": "bitmap_backup_1", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_1", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ @@ -2194,7 +2194,7 @@ expecting 12 dirty sectors; have 12. OK! {"return": {}} {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} =20 ---- Bitmap Backup #2 --- +--- Test Backup #2 --- =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} @@ -2204,12 +2204,12 @@ expecting 12 dirty sectors; have 12. OK! {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} {"return": {}} {} -{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bit= map_backup_2", "sync": "bitmap", "target": "bitmap_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} {"return": {}} -{"execute": "job-finalize", "arguments": {"id": "bitmap_backup_2"}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} -{"data": {"id": "bitmap_backup_2", "type": "backup"}, "event": "BLOCK_JOB_= PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} -{"data": {"device": "bitmap_backup_2", "len": 67108864, "offset": 67108864= , "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { "device0": [ --=20 2.21.0 From nobody Tue May 21 07:37:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562720951; cv=none; d=zoho.com; s=zohoarc; b=CoH9vJrshtMdv2Xngj1GLe9yUeUrM2YLWAreg0IkmnExeqHcEakI21iqlVzDSRvcXL0lQTJJlilVBLXl0WjYyooOUEieShRs/xJI7S8yMqMaJ3JziU7qpUuGr5FGLG48Iime3CRjK0BKzsTNkrsi188Y2y9O1FAPa5jYfmyrWP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562720951; h=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:ARC-Authentication-Results; bh=hSnyVkvydBJ6/0fK3biQsZMxEmdEdIyJs/HGCbDfZrI=; b=N9D21BAqN/UnKvTY+VEgVPmI7BqNVLYcrc75CN3EBycJCvEPfmI466ndcClxKPlcybWB1rVZAJ6WvS34fc47mKC1J5efimmW5u9HYWTU15apg0QfwfVm9ul+y3hk/TbzG4g8UKx6U7fLQv9B4JNbScO5TEUKHHO88XrdBjF6pks= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562720951226822.2278096722007; Tue, 9 Jul 2019 18:09:11 -0700 (PDT) Received: from localhost ([::1]:57334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl16R-000285-HR for importer@patchew.org; Tue, 09 Jul 2019 21:08:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49157) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl13q-0000RF-GJ for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl13n-0004US-EK for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53100) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hl13f-0004I3-5n; Tue, 09 Jul 2019 21:06:09 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FC9A3092664; Wed, 10 Jul 2019 01:06:05 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7401B1001B19; Wed, 10 Jul 2019 01:06:02 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 9 Jul 2019 21:05:52 -0400 Message-Id: <20190710010556.32365-5-jsnow@redhat.com> In-Reply-To: <20190710010556.32365-1-jsnow@redhat.com> References: <20190710010556.32365-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 10 Jul 2019 01:06:05 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/8] block/backup: hoist bitmap check into QMP interface 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 , John Snow , Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" This is nicer to do in the unified QMP interface that we have now, because it lets us use the right terminology back at the user. Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/backup.c | 13 ++++--------- blockdev.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/block/backup.c b/block/backup.c index e2729cf6fa..a64b768e24 100644 --- a/block/backup.c +++ b/block/backup.c @@ -566,6 +566,10 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, assert(bs); assert(target); =20 + /* QMP interface protects us from these cases */ + assert(sync_mode !=3D MIRROR_SYNC_MODE_INCREMENTAL); + assert(sync_bitmap || sync_mode !=3D MIRROR_SYNC_MODE_BITMAP); + if (bs =3D=3D target) { error_setg(errp, "Source and target cannot be the same"); return NULL; @@ -597,16 +601,7 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, return NULL; } =20 - /* QMP interface should have handled translating this to bitmap mode */ - assert(sync_mode !=3D MIRROR_SYNC_MODE_INCREMENTAL); - if (sync_mode =3D=3D MIRROR_SYNC_MODE_BITMAP) { - if (!sync_bitmap) { - error_setg(errp, "must provide a valid bitmap name for " - "'%s' sync mode", MirrorSyncMode_str(sync_mode)); - return NULL; - } - /* If we need to write to this bitmap, check that we can: */ if (bitmap_mode !=3D BITMAP_SYNC_MODE_NEVER && bdrv_dirty_bitmap_check(sync_bitmap, BDRV_BITMAP_DEFAULT, errp= )) { diff --git a/blockdev.c b/blockdev.c index 3e30bc2ca7..f0b7da53b0 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3464,6 +3464,16 @@ static BlockJob *do_backup_common(BackupCommon *back= up, return NULL; } =20 + if ((backup->sync =3D=3D MIRROR_SYNC_MODE_BITMAP) || + (backup->sync =3D=3D MIRROR_SYNC_MODE_INCREMENTAL)) { + /* done before desugaring 'incremental' to print the right message= */ + if (!backup->has_bitmap) { + error_setg(errp, "must provide a valid bitmap name for " + "'%s' sync mode", MirrorSyncMode_str(backup->sync)); + return NULL; + } + } + if (backup->sync =3D=3D MIRROR_SYNC_MODE_INCREMENTAL) { if (backup->has_bitmap_mode && backup->bitmap_mode !=3D BITMAP_SYNC_MODE_ON_SUCCESS) { --=20 2.21.0 From nobody Tue May 21 07:37:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562721110; cv=none; d=zoho.com; s=zohoarc; b=KWwQbLgLFzHOh5gfD/X4Qm/b3xS9e/8WQ8Vp0YaTfbcWmIdYfJEq+O/go928jEDUT3a/KpvnQ3Cw5Y27FjyMu3TrPRa1XCS9/9JhHJxCT77N42LiT+bO2YcmLM9+7UfHKmOpdVQ5crR3qp3FHYLVxi9B5nfTW7P42EV4bxPrcxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562721110; h=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:ARC-Authentication-Results; bh=8DZdub8fzv+qPEAPvj6lMe2lT0/cGFCpCe4Oz42rfyo=; b=OTeXAtcz+yIwGjlZvoW3GZXTiMaWQVYAUE6vLpR4RbKYNK3/3g+hMksIzshL6pS9GwDo9IQ6I7hVXRvBzGiOsbyfduiHZBVquwOxpxrPQ5lCjkiuJs05mq+Sa78qSghXK7sJkweQEs9N+Fh5Vlv6Fq5tQ/QYXMinrTHfFAWIYLg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156272111001112.784848113694807; Tue, 9 Jul 2019 18:11:50 -0700 (PDT) Received: from localhost ([::1]:57356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl199-0004e8-7j for importer@patchew.org; Tue, 09 Jul 2019 21:11:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49282) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl13t-0000Ve-SQ for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl13p-0004a2-FV for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54364) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hl13g-0004Ii-5o; Tue, 09 Jul 2019 21:06:09 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5D7CB369CC; Wed, 10 Jul 2019 01:06:06 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 934991001B19; Wed, 10 Jul 2019 01:06:05 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 9 Jul 2019 21:05:53 -0400 Message-Id: <20190710010556.32365-6-jsnow@redhat.com> In-Reply-To: <20190710010556.32365-1-jsnow@redhat.com> References: <20190710010556.32365-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 10 Jul 2019 01:06:06 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 5/8] iotests/257: test API failures 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 , John Snow , Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow Reviewed-by: Max Reitz --- tests/qemu-iotests/257 | 69 +++++++++++++++++++++++++++++++ tests/qemu-iotests/257.out | 85 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index 2eb4f26c28..de8707cb19 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -450,10 +450,79 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap= ', failure=3DNone): compare_images(img_path, fbackup2) log('') =20 +def test_backup_api(): + """ + """ + with iotests.FilePaths(['img', 'bsync1']) as \ + (img_path, backup_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 + } + + vm.qmp_log('blockdev-add', + filters=3D[iotests.filter_qmp_testfiles], + node_name=3D"drive0", + driver=3Ddrive0.fmt, + file=3Dfile_config) + drive0.node =3D 'drive0' + drive0.device =3D 'device0' + vm.qmp_log("device_add", id=3Ddrive0.device, + drive=3Ddrive0.name, driver=3D"scsi-hd") + log('') + + target0 =3D Drive(backup_path, vm=3Dvm) + target0.create_target("backup_target", drive0.fmt, drive0.size) + log('') + + vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.name, + 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], + }, + } + + for sync_mode, config in error_cases.items(): + log("-- Sync mode {:s} tests --\n".format(sync_mode)) + for bitmap, policies in config.items(): + for policy in policies: + kwargs =3D { 'job_id': 'api_job' } + if bitmap is not None: + kwargs['bitmap'] =3D bitmap + if policy is not None: + kwargs['bitmap-mode'] =3D policy + blockdev_backup(drive0.vm, drive0.name, "backup_target= ", + sync_mode, **kwargs) + log('') + + def main(): for bsync_mode in ("never", "on-success", "always"): for failure in ("simulated", "intermediate", None): test_bitmap_sync(bsync_mode, "bitmap", failure) =20 + test_backup_api() + if __name__ =3D=3D '__main__': iotests.script_main(main, supported_fmts=3D['qcow2']) diff --git a/tests/qemu-iotests/257.out b/tests/qemu-iotests/257.out index 0abc96acd3..43f2e0f9c9 100644 --- a/tests/qemu-iotests/257.out +++ b/tests/qemu-iotests/257.out @@ -2245,3 +2245,88 @@ qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID= -fbackup1" =3D=3D> Identical, OK qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! =20 + +=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": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0"}} +{"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-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "= backup_target"}} +{"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'incremental' sync mode"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "job-id": "api_job", "sync": "incremental", "target": "back= up_target"}} +{"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'incremental' sync mode"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backu= p_target"}} +{"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'incremental' sync mode"}} + +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "api_job", "sync": "incremental", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'incremental' sync mode"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "in= cremental", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "increm= ental", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "increme= ntal", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup= _target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "always", "device": "drive0", "job-id": "api_job", "sync": "incremen= tal", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "job-id": "api_job", "sync": "increment= al", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} + +-- Sync mode bitmap tests -- + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backu= p_target"}} +{"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'bitmap' sync mode"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_ta= rget"}} +{"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'bitmap' sync mode"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_tar= get"}} +{"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'bitmap' sync mode"}} + +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "api_job", "sync": "bitmap", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'bitmap' sync mode"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "bi= tmap", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "bitmap= ", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "bitmap"= , "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_targ= et"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target= "}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be give= n when providing a bitmap"}} + --=20 2.21.0 From nobody Tue May 21 07:37:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562720958; cv=none; d=zoho.com; s=zohoarc; b=eLQdV4skJ9iZthxr9ySyMLgnB5xWy2dw45ObMAZFKdHpL3dJ7aYBUwjfyjGnFl+ArUxE4vOhQ/de6lBuyp0SScREFrZ5asNdYdVP9KuX+HScSZKvGGIw0MZRZFsAukVcR7e0Tw4oFCxt0Y8ZJVbCRbOEkQuv+4A0yPARGXpyzOI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562720958; h=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:ARC-Authentication-Results; bh=61l2NO4oCuZigcYArZr4chjlJJB+0El7YzlAoMnzGlc=; b=Pofy0bnB3rZPIrxDvbqgH+DzQjLSzU8mtiA+a/rCmcVTa6W4ab8pe47yQEbNkdFcvBfIi5+X+uc4Fhxj520amWwo0Ldu0xs7rFRVjI5yup3U9KSs59xkPGSR///TugKWz1tbm7mpEpLC8D+SVgfS1HC0qsgNn62akzaGnmckxjg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562720958653569.8954835654791; Tue, 9 Jul 2019 18:09:18 -0700 (PDT) Received: from localhost ([::1]:57338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl16e-0002GT-05 for importer@patchew.org; Tue, 09 Jul 2019 21:09:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49257) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl13t-0000VB-Oc for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl13m-0004T5-Vn for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57000) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hl13h-0004Jh-56; Tue, 09 Jul 2019 21:06:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43C9E3082AED; Wed, 10 Jul 2019 01:06:07 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BCD61001B19; Wed, 10 Jul 2019 01:06:06 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 9 Jul 2019 21:05:54 -0400 Message-Id: <20190710010556.32365-7-jsnow@redhat.com> In-Reply-To: <20190710010556.32365-1-jsnow@redhat.com> References: <20190710010556.32365-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 10 Jul 2019 01:06:07 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 6/8] block/backup: issue progress updates for skipped regions 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 , John Snow , Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The way bitmap backups work is by starting at 75% if it needs to copy just 25% of the disk. The way sync=3Dtop currently works, however, is to start at 0% and then never update the progress if it doesn't copy a region. If it needs to copy 25% of the disk, we'll finish at 25%. Update the progress when we skip regions. Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/backup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/backup.c b/block/backup.c index a64b768e24..38c4a688c6 100644 --- a/block/backup.c +++ b/block/backup.c @@ -417,6 +417,7 @@ static int coroutine_fn backup_loop(BackupBlockJob *job) if (job->sync_mode =3D=3D MIRROR_SYNC_MODE_TOP && bdrv_is_unallocated_range(bs, offset, job->cluster_size)) { + job_progress_update(&job->common.job, job->cluster_size); bdrv_reset_dirty_bitmap(job->copy_bitmap, offset, job->cluster_size); continue; --=20 2.21.0 From nobody Tue May 21 07:37:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562721654; cv=none; d=zoho.com; s=zohoarc; b=HVRuj2tFW8SCMw2o+9EHEYoRfgm5Eye4g/rVzXElNCAhTOa2BYaeAB5QemApkfh8KXmPiRSpN5Se7kNKGychwHRZm778mTqP+PE3K69fOnp4q4kf0MdWbiTHZC4NgpHHadptCiiyeeoZT/82sXUDDftybt/965REMhqgt1zI6m0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562721654; h=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:ARC-Authentication-Results; bh=jJEUKobJPG55pvGCcI4Sh6VikJuPD9QNypBAuewRAK0=; b=IJaRffFpwpYJcOkPROVhyUlpBLldj3Mm5y2HcrsfySTHXjDBH+8FhWwJkiHie6ybs44Vpt2zxGAoavN06KnB+D3igKEFRNy7PrWkgz0jXHB2gG49NY23UD1wyzNNNVqHeHu3DhR67amkgJlCgfD2yrh/HYKyAIhRS6fglYbGYNs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562721654956641.6159138715475; Tue, 9 Jul 2019 18:20:54 -0700 (PDT) Received: from localhost ([::1]:57400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl1Hu-0000WF-Ju for importer@patchew.org; Tue, 09 Jul 2019 21:20:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49302) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl13v-0000X1-Im for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl13q-0004cI-Lv for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49014) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hl13j-0004K3-50; Tue, 09 Jul 2019 21:06:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2EDF5308212A; Wed, 10 Jul 2019 01:06:08 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65EB01001B19; Wed, 10 Jul 2019 01:06:07 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 9 Jul 2019 21:05:55 -0400 Message-Id: <20190710010556.32365-8-jsnow@redhat.com> In-Reply-To: <20190710010556.32365-1-jsnow@redhat.com> References: <20190710010556.32365-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 10 Jul 2019 01:06:08 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 7/8] block/backup: support bitmap sync modes for non-bitmap backups 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 , John Snow , Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Accept bitmaps and sync policies for the other backup modes. This allows us to do things like create a bitmap synced to a full backup without a transaction, or start a resumable backup process. Some combinations don't make sense, though: - NEVER policy combined with any non-BITMAP mode doesn't do anything, because the bitmap isn't used for input or output. It's harmless, but is almost certainly never what the user wanted. - sync=3DNONE is more questionable. It can't use on-success because this job never completes with success anyway, and the resulting artifact of 'always' is suspect: because we start with a full bitmap and only copy out segments that get written to, the final output bitmap will always be ... a fully set bitmap. Maybe there's contexts in which bitmaps make sense for sync=3Dnone, but not without more severe changes to the current job, and omitting it here doesn't prevent us from adding it later. Signed-off-by: John Snow Reviewed-by: Max Reitz --- block/backup.c | 8 +------- blockdev.c | 22 ++++++++++++++++++++++ qapi/block-core.json | 6 ++++-- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/block/backup.c b/block/backup.c index 38c4a688c6..b94ed595ba 100644 --- a/block/backup.c +++ b/block/backup.c @@ -602,7 +602,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, return NULL; } =20 - if (sync_mode =3D=3D MIRROR_SYNC_MODE_BITMAP) { + if (sync_bitmap) { /* If we need to write to this bitmap, check that we can: */ if (bitmap_mode !=3D BITMAP_SYNC_MODE_NEVER && bdrv_dirty_bitmap_check(sync_bitmap, BDRV_BITMAP_DEFAULT, errp= )) { @@ -613,12 +613,6 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, if (bdrv_dirty_bitmap_create_successor(bs, sync_bitmap, errp) < 0)= { return NULL; } - } else if (sync_bitmap) { - error_setg(errp, - "a bitmap was given to backup_job_create, " - "but it received an incompatible sync_mode (%s)", - MirrorSyncMode_str(sync_mode)); - return NULL; } =20 len =3D bdrv_getlength(bs); diff --git a/blockdev.c b/blockdev.c index f0b7da53b0..bc152f8e0d 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3502,6 +3502,28 @@ static BlockJob *do_backup_common(BackupCommon *back= up, if (bdrv_dirty_bitmap_check(bmap, BDRV_BITMAP_ALLOW_RO, errp)) { return NULL; } + + /* This does not produce a useful bitmap artifact: */ + if (backup->sync =3D=3D MIRROR_SYNC_MODE_NONE) { + error_setg(errp, "sync mode '%s' does not produce meaningful b= itmap" + " outputs", MirrorSyncMode_str(backup->sync)); + return NULL; + } + + /* If the bitmap isn't used for input or output, this is useless: = */ + if (backup->bitmap_mode =3D=3D BITMAP_SYNC_MODE_NEVER && + backup->sync !=3D MIRROR_SYNC_MODE_BITMAP) { + error_setg(errp, "Bitmap sync mode '%s' has no meaningful effe= ct" + " when combined with sync mode '%s'", + BitmapSyncMode_str(backup->bitmap_mode), + MirrorSyncMode_str(backup->sync)); + return NULL; + } + } + + if (!backup->has_bitmap && backup->has_bitmap_mode) { + error_setg(errp, "Cannot specify Bitmap sync mode without a bitmap= "); + return NULL; } =20 if (!backup->auto_finalize) { diff --git a/qapi/block-core.json b/qapi/block-core.json index 5a578806c5..099e4f37b2 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1352,13 +1352,15 @@ # @speed: the maximum speed, in bytes per second. The default is 0, # for unlimited. # -# @bitmap: the name of a dirty bitmap if sync is "bitmap" or "incremental". +# @bitmap: The name of a dirty bitmap to use. # Must be present if sync is "bitmap" or "incremental". +# Can be present if sync is "full" or "top". # Must not be present otherwise. # (Since 2.4 (drive-backup), 3.1 (blockdev-backup)) # # @bitmap-mode: Specifies the type of data the bitmap should contain after -# the operation concludes. Must be present if sync is "bitma= p". +# the operation concludes. +# Must be present if a bitmap was provided, # Must NOT be present otherwise. (Since 4.2) # # @compress: true to compress data, if the target format supports it. --=20 2.21.0 From nobody Tue May 21 07:37:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1562721479; cv=none; d=zoho.com; s=zohoarc; b=C750hXiT31/YDnCNxpKrMxSxOsNmCBviTv8cIAIN5Vgblm+qm8CvTU5KQBdnhZXuqAPh/SGD+rBmMcL14atcMC0oYg+Vlt/e5vyyGN8UtLR8WHZgtPJchc+44974SdYKQYJhdHgs7Sf+7c+KS+1DZMjzHEOkAkmvo7qbn/+H6sA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562721479; h=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:ARC-Authentication-Results; bh=a3Or8WvFQYPoHPB2O+YF7quDy9j0we8+u10nlTd0ZAk=; b=jmj/vT6fJb2S4GGV/io8bOgg76gJOms8QyzVWWW4rJMtL9sAKeyQioyqDv+Dp7TrvC4QbfsM5EYCpQUlH1Vt7nnKrbwMsslnhnmkm1erdtov/wLcjVcvAEwKQliAhtOaxs7/FyjbshD6ZFK3TuxBx8bp2ReMBPbh28MsiH9N7lE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562721479267790.8477573086304; Tue, 9 Jul 2019 18:17:59 -0700 (PDT) Received: from localhost ([::1]:57378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl1Eu-000747-JL for importer@patchew.org; Tue, 09 Jul 2019 21:17:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49790) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hl14K-0000u6-F4 for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hl146-0004wr-LB for qemu-devel@nongnu.org; Tue, 09 Jul 2019 21:06:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49020) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hl13j-0004LS-39; Tue, 09 Jul 2019 21:06:13 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 35CC23086220; Wed, 10 Jul 2019 01:06:09 +0000 (UTC) Received: from probe.bos.redhat.com (dhcp-17-215.bos.redhat.com [10.18.17.215]) by smtp.corp.redhat.com (Postfix) with ESMTP id 517E71001B1B; Wed, 10 Jul 2019 01:06:08 +0000 (UTC) From: John Snow To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Tue, 9 Jul 2019 21:05:56 -0400 Message-Id: <20190710010556.32365-9-jsnow@redhat.com> In-Reply-To: <20190710010556.32365-1-jsnow@redhat.com> References: <20190710010556.32365-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 10 Jul 2019 01:06:09 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 8/8] iotests/257: test traditional sync modes 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 , John Snow , Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow --- tests/qemu-iotests/257 | 31 + tests/qemu-iotests/257.out | 3089 ++++++++++++++++++++++++++++++++++++ 2 files changed, 3120 insertions(+) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index de8707cb19..8de1c4da19 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -288,6 +288,12 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap'= , failure=3DNone): Bitmaps are always synchronized, regardless of failu= re. (Partial images must be kept.) =20 + :param msync_mode: The mirror sync mode to use for the first backup. + Can be any one of: + - bitmap: Backups based on bitmap manifest. + - full: Full backups. + - top: Full backups 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. @@ -410,6 +416,11 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap'= , failure=3DNone): if bsync_mode =3D=3D 'always' and failure =3D=3D 'intermediate': # We manage to copy one sector (one bit) before the error. ebitmap.clear_bit(ebitmap.first_bit) + if msync_mode in ('full', 'top'): + # These modes return all bits set except what was copied/s= kipped + fail_bit =3D ebitmap.first_bit + ebitmap.clear() + ebitmap.dirty_bits(range(fail_bit, SIZE // GRANULARITY)) ebitmap.compare(get_bitmap(bitmaps, drive0.device, 'bitmap0')) =20 # 2 - Writes and Reference Backup @@ -501,6 +512,21 @@ def test_backup_api(): 'bitmap404': ['on-success', 'always', 'never', None], 'bitmap0': [None], }, + 'full': { + None: ['on-success', 'always', 'never'], + 'bitmap404': ['on-success', 'always', 'never', None], + 'bitmap0': ['never', None], + }, + 'top': { + None: ['on-success', 'always', 'never'], + 'bitmap404': ['on-success', 'always', 'never', None], + 'bitmap0': ['never', None], + }, + 'none': { + None: ['on-success', 'always', 'never'], + 'bitmap404': ['on-success', 'always', 'never', None], + 'bitmap0': ['on-success', 'always', 'never', None], + } } =20 for sync_mode, config in error_cases.items(): @@ -522,6 +548,11 @@ def main(): for failure in ("simulated", "intermediate", None): test_bitmap_sync(bsync_mode, "bitmap", failure) =20 + 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_backup_api() =20 if __name__ =3D=3D '__main__': diff --git a/tests/qemu-iotests/257.out b/tests/qemu-iotests/257.out index 43f2e0f9c9..304e33ab73 100644 --- a/tests/qemu-iotests/257.out +++ b/tests/qemu-iotests/257.out @@ -2246,6 +2246,3002 @@ qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/P= ID-fbackup2" =3D=3D> Identical, OK qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! =20 =20 +=3D=3D=3D Mode full; 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": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_1", "sync": "full", "target": "backup_target_1"}} +{"return": {}} + +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "persistent": false, + "recording": false, + "status": "disabled" + }, + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "frozen" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +=3D Checking Bitmap (anonymous) =3D +expecting 7 dirty sectors; have 7. OK! + +{"execute": "job-cancel", "arguments": {"id": "backup_1"}} +{"return": {}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=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": { + "device0": [ + { + "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 Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode full; 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}], "set-state": [{"event": "flush_to_disk", "new= -state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]= }, "node-name": "drive0"}} +{"return": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +{"return": ""} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_1", "sync": "full", "target": "backup_target_1"}} +{"return": {}} +{"data": {"action": "report", "device": "backup_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"device": "backup_1", "error": "Input/output error", "len": 6710= 8864, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_= COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 917504, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 14 dirty sectors; have 14. OK! + +--- Reference Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode full; 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": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_1", "sync": "full", "target": "backup_target_1"}} +{"return": {}} + +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "persistent": false, + "recording": false, + "status": "disabled" + }, + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "frozen" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +=3D Checking Bitmap (anonymous) =3D +expecting 7 dirty sectors; have 7. OK! + +{"execute": "job-finalize", "arguments": {"id": "backup_1"}} +{"return": {}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 7 dirty sectors; have 7. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 786432, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 12 dirty sectors; have 12. OK! + +--- Reference Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode full; 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": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_1", "sync": "full", "target": "backup_target_1"}} +{"return": {}} + +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "persistent": false, + "recording": false, + "status": "disabled" + }, + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "frozen" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +=3D Checking Bitmap (anonymous) =3D +expecting 7 dirty sectors; have 7. OK! + +{"execute": "job-cancel", "arguments": {"id": "backup_1"}} +{"return": {}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 7 dirty sectors; have 7. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 786432, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 12 dirty sectors; have 12. OK! + +--- Reference Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode full; 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}], "set-state": [{"event": "flush_to_disk", "new= -state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]= }, "node-name": "drive0"}} +{"return": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +{"return": ""} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_1", "sync": "full", "target": "backup_target_1"}} +{"return": {}} +{"data": {"action": "report", "device": "backup_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"device": "backup_1", "error": "Input/output error", "len": 6710= 8864, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_= COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 66125824, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 1009 dirty sectors; have 1009. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 66453504, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 1014 dirty sectors; have 1014. OK! + +--- Reference Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode full; 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": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_1", "sync": "full", "target": "backup_target_1"}} +{"return": {}} + +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "persistent": false, + "recording": false, + "status": "disabled" + }, + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "frozen" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +=3D Checking Bitmap (anonymous) =3D +expecting 7 dirty sectors; have 7. OK! + +{"execute": "job-finalize", "arguments": {"id": "backup_1"}} +{"return": {}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 7 dirty sectors; have 7. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 786432, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 12 dirty sectors; have 12. OK! + +--- Reference Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode top; 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": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_1", "sync": "top", "target": "backup_target_1"}} +{"return": {}} + +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "persistent": false, + "recording": false, + "status": "disabled" + }, + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "frozen" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +=3D Checking Bitmap (anonymous) =3D +expecting 7 dirty sectors; have 7. OK! + +{"execute": "job-cancel", "arguments": {"id": "backup_1"}} +{"return": {}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 655360, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=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": { + "device0": [ + { + "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 Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode top; 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}], "set-state": [{"event": "flush_to_disk", "new= -state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]= }, "node-name": "drive0"}} +{"return": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +{"return": ""} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_1", "sync": "top", "target": "backup_target_1"}} +{"return": {}} +{"data": {"action": "report", "device": "backup_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"device": "backup_1", "error": "Input/output error", "len": 6710= 8864, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_= COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 917504, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 14 dirty sectors; have 14. OK! + +--- Reference Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode top; 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": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_1", "sync": "top", "target": "backup_target_1"}} +{"return": {}} + +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "persistent": false, + "recording": false, + "status": "disabled" + }, + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "frozen" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +=3D Checking Bitmap (anonymous) =3D +expecting 7 dirty sectors; have 7. OK! + +{"execute": "job-finalize", "arguments": {"id": "backup_1"}} +{"return": {}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 7 dirty sectors; have 7. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 786432, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 12 dirty sectors; have 12. OK! + +--- Reference Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode top; 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": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_1", "sync": "top", "target": "backup_target_1"}} +{"return": {}} + +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "persistent": false, + "recording": false, + "status": "disabled" + }, + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "frozen" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +=3D Checking Bitmap (anonymous) =3D +expecting 7 dirty sectors; have 7. OK! + +{"execute": "job-cancel", "arguments": {"id": "backup_1"}} +{"return": {}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 7 dirty sectors; have 7. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 786432, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 12 dirty sectors; have 12. OK! + +--- Reference Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode top; 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}], "set-state": [{"event": "flush_to_disk", "new= -state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]= }, "node-name": "drive0"}} +{"return": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +{"return": ""} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_1", "sync": "top", "target": "backup_target_1"}} +{"return": {}} +{"data": {"action": "report", "device": "backup_1", "operation": "read"}, = "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds= ": "SECS"}} +{"data": {"device": "backup_1", "error": "Input/output error", "len": 6710= 8864, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_= COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 66125824, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 1009 dirty sectors; have 1009. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 66453504, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 1014 dirty sectors; have 1014. OK! + +--- Reference Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Mis= match, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + +=3D=3D=3D Mode top; 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": {}} +{"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi= -hd", "id": "device0", "share-rw": true}} +{"return": {}} + +--- Write #0 --- + +write -P0x49 0x0000000 0x10000 +{"return": ""} +write -P0x6c 0x0100000 0x10000 +{"return": ""} +write -P0x6f 0x2000000 0x10000 +{"return": ""} +write -P0x76 0x3ff0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [] + } +} + +--- Reference Backup #0 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_0", "sync": "full", "target": "ref_target_0"}} +{"return": {}} +{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "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": { + "device0": [ + { + "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 Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_1", "sync": "full", "target": "ref_target_1"}} +{"return": {}} +{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #1 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_1", "sync": "top", "target": "backup_target_1"}} +{"return": {}} + +--- Write #2 --- + +write -P0x74 0x0010000 0x10000 +{"return": ""} +write -P0x69 0x00e8000 0x10000 +{"return": ""} +write -P0x6e 0x2018000 0x10000 +{"return": ""} +write -P0x67 0x3fe0000 0x20000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 0, + "granularity": 65536, + "persistent": false, + "recording": false, + "status": "disabled" + }, + { + "busy": false, + "count": 458752, + "granularity": 65536, + "persistent": false, + "recording": true, + "status": "active" + }, + { + "busy": true, + "count": 393216, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "frozen" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 6 dirty sectors; have 6. OK! + +=3D Checking Bitmap (anonymous) =3D +expecting 7 dirty sectors; have 7. OK! + +{"execute": "job-finalize", "arguments": {"id": "backup_1"}} +{"return": {}} +{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 458752, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 7 dirty sectors; have 7. OK! + +--- Write #3 --- + +write -P0xaa 0x0010000 0x30000 +{"return": ""} +write -P0xbb 0x00d8000 0x10000 +{"return": ""} +write -P0xcc 0x2028000 0x10000 +{"return": ""} +write -P0xdd 0x3fc0000 0x10000 +{"return": ""} +{ + "bitmaps": { + "device0": [ + { + "busy": false, + "count": 786432, + "granularity": 65536, + "name": "bitmap0", + "persistent": false, + "recording": true, + "status": "active" + } + ] + } +} + +=3D Checking Bitmap bitmap0 =3D +expecting 12 dirty sectors; have 12. OK! + +--- Reference Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "ref_backup_2", "sync": "full", "target": "ref_target_2"}} +{"return": {}} +{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "= speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": = {"microseconds": "USECS", "seconds": "SECS"}} + +--- Test Backup #2 --- + +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} +{"return": {}} +{} +{} +{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} +{"return": {}} +{} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"return": {}} +{"execute": "job-finalize", "arguments": {"id": "backup_2"}} +{"return": {}} +{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING= ", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"device": "backup_2", "len": 67108864, "offset": 67108864, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} +{ + "bitmaps": { + "device0": [ + { + "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": { + "device0": [] + } +} + +--- Verification --- + +qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" =3D=3D> Ide= ntical, OK! +qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" =3D=3D> Identi= cal, OK! + + =3D=3D=3D API failure tests =3D=3D=3D =20 --- Preparing image & VM --- @@ -2330,3 +5326,96 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fb= ackup2" =3D=3D> Identical, OK! {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target= "}} {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be give= n when providing a bitmap"}} =20 +-- Sync mode full tests -- + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_= target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify Bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_targ= et"}} +{"error": {"class": "GenericError", "desc": "Cannot specify Bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_targe= t"}} +{"error": {"class": "GenericError", "desc": "Cannot specify Bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "fu= ll", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "full",= "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "full", = "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target= "}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "job-id": "api_job", "sync": "full", "t= arget": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode 'never' has = no meaningful effect when combined with sync mode 'full'"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be give= n when providing a bitmap"}} + +-- Sync mode top tests -- + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_t= arget"}} +{"error": {"class": "GenericError", "desc": "Cannot specify Bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_targe= t"}} +{"error": {"class": "GenericError", "desc": "Cannot specify Bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target= "}} +{"error": {"class": "GenericError", "desc": "Cannot specify Bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "to= p", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "top", = "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "top", "= target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"= }} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "job-id": "api_job", "sync": "top", "ta= rget": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode 'never' has = no meaningful effect when combined with sync mode 'top'"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be give= n when providing a bitmap"}} + +-- Sync mode none tests -- + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_= target"}} +{"error": {"class": "GenericError", "desc": "Cannot specify Bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_targ= et"}} +{"error": {"class": "GenericError", "desc": "Cannot specify Bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_targe= t"}} +{"error": {"class": "GenericError", "desc": "Cannot specify Bitmap sync mo= de without a bitmap"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "no= ne", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "none",= "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "none", = "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target= "}} +{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "none= ", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "sync mode 'none' does not pro= duce meaningful bitmap outputs"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "always", "device": "drive0", "job-id": "api_job", "sync": "none", "= target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "sync mode 'none' does not pro= duce meaningful bitmap outputs"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "job-id": "api_job", "sync": "none", "t= arget": "backup_target"}} +{"error": {"class": "GenericError", "desc": "sync mode 'none' does not pro= duce meaningful bitmap outputs"}} + +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}} +{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be give= n when providing a bitmap"}} + --=20 2.21.0