From nobody Fri May 3 23:42:06 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=1565023229; cv=none; d=zoho.com; s=zohoarc; b=M24gR+MZYCsIy7EGsEYZy8JU4S172c/JLoce3Q2GRoSI2JxsGV/PHbu6/BNMGHo0DurB1Tz0Wra2ze5ss1WK5nlegUGAdAJQlgZXfeo1Pzd7v0zUHavIxpTYlhGQ40dxW5ZxU0d4MW+kaNjXV26agrtGk5mlambz+djDICKdcr8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565023229; 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=3uLLEThlWjRxq2vUfatS+RTB3Q1xSXuAqlPFWzQUhy4=; b=EGBwlZpMnWTc7kYHLevWElTw+xUL12DCHDzspfgNYVQCQutscVTs4CzzUkj+fxdrT2HcoMa0uog64HRtAibjk9edAYtMcWSd6tYKRZVH/VKrF6siVg3pLVMMMqUgb72+8fMKYOLt/Zhx1BJ4VYLLStMjlts/yhGjIOnpy+ieeTE= 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 1565023229692272.64940312085935; Mon, 5 Aug 2019 09:40:29 -0700 (PDT) Received: from localhost ([::1]:55974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hug28-0001qN-MG for importer@patchew.org; Mon, 05 Aug 2019 12:40:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37443) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hufzZ-0005eh-9F for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:37:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hufzY-0005pZ-99 for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:37:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35214) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hufzW-0005oV-6v; Mon, 05 Aug 2019 12:37:46 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 712F83002E27; Mon, 5 Aug 2019 16:37:45 +0000 (UTC) Received: from localhost (unknown [10.40.205.217]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 069205DC18; Mon, 5 Aug 2019 16:37:44 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 5 Aug 2019 18:37:34 +0200 Message-Id: <20190805163740.23616-2-mreitz@redhat.com> In-Reply-To: <20190805163740.23616-1-mreitz@redhat.com> References: <20190805163740.23616-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 05 Aug 2019 16:37:45 +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] [PULL 1/7] backup: Copy only dirty areas 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 , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The backup job must only copy areas that the copy_bitmap reports as dirty. This is always the case when using traditional non-offloading backup, because it copies each cluster separately. When offloading the copy operation, we sometimes copy more than one cluster at a time, but we only check whether the first one is dirty. Therefore, whenever copy offloading is possible, the backup job currently produces wrong output when the guest writes to an area of which an inner part has already been backed up, because that inner part will be re-copied. Fixes: 9ded4a0114968e98b41494fc035ba14f84cdf700 Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20190801173900.23851-2-mreitz@redhat.com Signed-off-by: Max Reitz --- block/backup.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/block/backup.c b/block/backup.c index 715e1d3be8..1ee271f9f1 100644 --- a/block/backup.c +++ b/block/backup.c @@ -202,22 +202,31 @@ static int coroutine_fn backup_do_cow(BackupBlockJob = *job, cow_request_begin(&cow_request, job, start, end); =20 while (start < end) { + int64_t dirty_end; + if (!hbitmap_get(job->copy_bitmap, start)) { trace_backup_do_cow_skip(job, start); start +=3D job->cluster_size; continue; /* already copied */ } =20 + dirty_end =3D hbitmap_next_zero(job->copy_bitmap, start, (end - st= art)); + if (dirty_end < 0) { + dirty_end =3D end; + } + trace_backup_do_cow_process(job, start); =20 if (job->use_copy_range) { - ret =3D backup_cow_with_offload(job, start, end, is_write_noti= fier); + ret =3D backup_cow_with_offload(job, start, dirty_end, + is_write_notifier); if (ret < 0) { job->use_copy_range =3D false; } } if (!job->use_copy_range) { - ret =3D backup_cow_with_bounce_buffer(job, start, end, is_writ= e_notifier, + ret =3D backup_cow_with_bounce_buffer(job, start, dirty_end, + is_write_notifier, error_is_read, &bounce_buf= fer); } if (ret < 0) { --=20 2.21.0 From nobody Fri May 3 23:42:06 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=1565023145; cv=none; d=zoho.com; s=zohoarc; b=WgcUqr4nPLahk/MJnY58OrGyZxzY3Pa5OINj04Hu6etO16nZgVl3blvXdvenRKTjf6+sBMm9pFp2zcE+Xn2kDmwe/Qdd0XzMU1hkLqBHvqUwZzizZVMq1wTtdVjOvufUF/+FwITqQD2FFeblJ1l8b1l7pcYGZ6DbueGwZs1ras4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565023145; 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=kb15m41bIIbUGIeC1aEXLQprnaarAGRi4NtHzRb1e7Y=; b=Ui2qT03FpZICVqK4rBp7S+ocH9DfHtxJEcV+aWWt6mzeZzScyCpWbewKPi6qVXuYJpVfeZgcVjPHICRD/Wp4dlmmAMC0q4D1NhzVAnR6RlhuZZ2OcBFzdNPVEXVrKeJR5N7W61IORo1dvdDwtHroT3gSq+Ik2wUtRTdIEP9LzbU= 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 1565023145899554.0065620378875; Mon, 5 Aug 2019 09:39:05 -0700 (PDT) Received: from localhost ([::1]:55952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hug0k-0007cO-97 for importer@patchew.org; Mon, 05 Aug 2019 12:39:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37476) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hufzc-0005mU-Cz for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:37:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hufzb-0005v2-5w for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:37:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60155) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hufzY-0005pG-Fq; Mon, 05 Aug 2019 12:37:48 -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 B6418307CDFC; Mon, 5 Aug 2019 16:37:47 +0000 (UTC) Received: from localhost (unknown [10.40.205.217]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D0101001B17; Mon, 5 Aug 2019 16:37:47 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 5 Aug 2019 18:37:35 +0200 Message-Id: <20190805163740.23616-3-mreitz@redhat.com> In-Reply-To: <20190805163740.23616-1-mreitz@redhat.com> References: <20190805163740.23616-1-mreitz@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.49]); Mon, 05 Aug 2019 16:37:47 +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] [PULL 2/7] iotests: Test backup job with two guest writes 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 , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Perform two guest writes to not yet backed up areas of an image, where the former touches an inner area of the latter. Before HEAD^, copy offloading broke this in two ways: (1) The target image differs from the reference image (what the source was when the backup started). (2) But you will not see that in the failing output, because the job offset is reported as being greater than the job length. This is because one cluster is copied twice, and thus accounted for twice, but of course the job length does not increase. Signed-off-by: Max Reitz Message-id: 20190801173900.23851-3-mreitz@redhat.com Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Max Reitz --- tests/qemu-iotests/056 | 39 ++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/056.out | 4 ++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056 index f40fc11a09..e761e465ae 100755 --- a/tests/qemu-iotests/056 +++ b/tests/qemu-iotests/056 @@ -133,6 +133,7 @@ class BackupTest(iotests.QMPTestCase): self.vm =3D iotests.VM() self.test_img =3D img_create('test') self.dest_img =3D img_create('dest') + self.ref_img =3D img_create('ref') self.vm.add_drive(self.test_img) self.vm.launch() =20 @@ -140,6 +141,7 @@ class BackupTest(iotests.QMPTestCase): self.vm.shutdown() try_remove(self.test_img) try_remove(self.dest_img) + try_remove(self.ref_img) =20 def hmp_io_writes(self, drive, patterns): for pattern in patterns: @@ -177,6 +179,43 @@ class BackupTest(iotests.QMPTestCase): self.assert_qmp(event, 'data/error', qerror) return False =20 + def test_overlapping_writes(self): + # Write something to back up + self.hmp_io_writes('drive0', [('42', '0M', '2M')]) + + # Create a reference backup + self.qmp_backup_and_wait(device=3D'drive0', format=3Diotests.imgfm= t, + sync=3D'full', target=3Dself.ref_img, + auto_dismiss=3DFalse) + res =3D self.vm.qmp('block-job-dismiss', id=3D'drive0') + self.assert_qmp(res, 'return', {}) + + # Now to the test backup: We simulate the following guest + # writes: + # (1) [1M + 64k, 1M + 128k): Afterwards, everything in that + # area should be in the target image, and we must not copy + # it again (because the source image has changed now) + # (64k is the job's cluster size) + # (2) [1M, 2M): The backup job must not get overeager. It + # must copy [1M, 1M + 64k) and [1M + 128k, 2M) separately, + # but not the area in between. + + self.qmp_backup(device=3D'drive0', format=3Diotests.imgfmt, sync= =3D'full', + target=3Dself.dest_img, speed=3D1, auto_dismiss=3D= False) + + self.hmp_io_writes('drive0', [('23', '%ik' % (1024 + 64), '64k'), + ('66', '1M', '1M')]) + + # Let the job complete + res =3D self.vm.qmp('block-job-set-speed', device=3D'drive0', spee= d=3D0) + self.assert_qmp(res, 'return', {}) + self.qmp_backup_wait('drive0') + res =3D self.vm.qmp('block-job-dismiss', id=3D'drive0') + self.assert_qmp(res, 'return', {}) + + self.assertTrue(iotests.compare_images(self.ref_img, self.dest_img= ), + 'target image does not match reference image') + def test_dismiss_false(self): res =3D self.vm.qmp('query-block-jobs') self.assert_qmp(res, 'return', []) diff --git a/tests/qemu-iotests/056.out b/tests/qemu-iotests/056.out index dae404e278..36376bed87 100644 --- a/tests/qemu-iotests/056.out +++ b/tests/qemu-iotests/056.out @@ -1,5 +1,5 @@ -......... +.......... ---------------------------------------------------------------------- -Ran 9 tests +Ran 10 tests =20 OK --=20 2.21.0 From nobody Fri May 3 23:42:06 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=1565023143; cv=none; d=zoho.com; s=zohoarc; b=kSb6UPNLON5PoSPWswlATT+OmgWad//ym/4iFc+ULx/LOa4QVXZykNeIlWmCPLIwd/P4CSHr5STUBKIMGG7D4Zb8YQjhFf9kkQFSZ9XpgluCRcXE/C3VSTsNZ9vicigNRiCaQs3CWd4yz8E2nuf93TVABqAC4DO/tmDaNh6KiG0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565023143; 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=t8f0WmZ015RvUxLihuJSe2fHFYoqS7huEAaViCPryts=; b=BnvE/vMpeF3qiOB1XcYHCr7v/5sl07OGOt5tax93z5wX8q14Exp4gzePk5A7hkByd/wsx1aBMYmQv0rV0ceUh2Y6oknMHU1emf3l3gTaQU8zSY7LGqBNGWT30dxqILridhGeYELvaJPkcQN77gSdTDJJ1/y1/dxNVQvP/csJX08= 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 1565023143845962.7813610023551; Mon, 5 Aug 2019 09:39:03 -0700 (PDT) Received: from localhost ([::1]:55950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hug0h-0007X9-Qh for importer@patchew.org; Mon, 05 Aug 2019 12:38:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37495) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hufzd-0005p8-Sb for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:37:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hufzd-0005vf-0E for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:37:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48118) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hufza-0005uh-Sw; Mon, 05 Aug 2019 12:37:51 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15AC930860CD; Mon, 5 Aug 2019 16:37:50 +0000 (UTC) Received: from localhost (unknown [10.40.205.217]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F6DF5D71C; Mon, 5 Aug 2019 16:37:49 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 5 Aug 2019 18:37:36 +0200 Message-Id: <20190805163740.23616-4-mreitz@redhat.com> In-Reply-To: <20190805163740.23616-1-mreitz@redhat.com> References: <20190805163740.23616-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 05 Aug 2019 16:37:50 +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] [PULL 3/7] util/hbitmap: update orig_size on truncate 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 , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Without this, hbitmap_next_zero and hbitmap_next_dirty_area are broken after truncate. So, orig_size is broken since it's introduction in 76d570dc495c56bb. Fixes: 76d570dc495c56bb Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20190805120120.23585-1-vsementsov@virtuozzo.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- util/hbitmap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/hbitmap.c b/util/hbitmap.c index 7905212a8b..bcc0acdc6a 100644 --- a/util/hbitmap.c +++ b/util/hbitmap.c @@ -53,7 +53,9 @@ */ =20 struct HBitmap { - /* Size of the bitmap, as requested in hbitmap_alloc. */ + /* + * Size of the bitmap, as requested in hbitmap_alloc or in hbitmap_tru= ncate. + */ uint64_t orig_size; =20 /* Number of total bits in the bottom level. */ @@ -732,6 +734,8 @@ void hbitmap_truncate(HBitmap *hb, uint64_t size) uint64_t num_elements =3D size; uint64_t old; =20 + hb->orig_size =3D size; + /* Size comes in as logical elements, adjust for granularity. */ size =3D (size + (1ULL << hb->granularity) - 1) >> hb->granularity; assert(size <=3D ((uint64_t)1 << HBITMAP_LOG_MAX_SIZE)); --=20 2.21.0 From nobody Fri May 3 23:42:06 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=1565023282; cv=none; d=zoho.com; s=zohoarc; b=LioHb9LE9Wif2NN9G9TVzYzfuIlg1zCIl5lFElilv4u+ME4T2IJEiFS6OqKDD5wsPfZkd+OGuihOGh2YcuBEyCdKvdE7DLQx5Aa+uHX/026ALyZ6CaH4kNO1WcVYLLMIgIbmmN8rHwumd/F7aLeVERSaB1yjHFvTAbiKf/MlalI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565023282; 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=SjqeTuW2WLFU85WqkhE/76l1O45n/9kPhgDnfuOBEyo=; b=etd4aa503ePflkzO/HahJEvL4jyrzGd+iBSd0oJeHDcn8lXwYc255A/IkE5+7bUlY2K0IzZsxRmFlrRByuok5HFSHtYKaH7FxZISN0EhtWqYe2u+jaJFGbyeWvT1dF4sdZhOg5lKYQw6JWxda035teVpLHxwLnEp+DhjIAD+2yM= 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 1565023282788592.2685307601237; Mon, 5 Aug 2019 09:41:22 -0700 (PDT) Received: from localhost ([::1]:55988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hug2z-0003Vl-Tu for importer@patchew.org; Mon, 05 Aug 2019 12:41:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37527) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hufzg-0005wl-Hj for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:37:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hufzf-0005wi-GK for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:37:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41710) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hufzd-0005vT-3h; Mon, 05 Aug 2019 12:37:53 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C8A7301302E; Mon, 5 Aug 2019 16:37:52 +0000 (UTC) Received: from localhost (unknown [10.40.205.217]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E4AF25DC18; Mon, 5 Aug 2019 16:37:51 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 5 Aug 2019 18:37:37 +0200 Message-Id: <20190805163740.23616-5-mreitz@redhat.com> In-Reply-To: <20190805163740.23616-1-mreitz@redhat.com> References: <20190805163740.23616-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 05 Aug 2019 16:37:52 +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] [PULL 4/7] iotests: Test incremental backup after truncation 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 , Peter Maydell , qemu-devel@nongnu.org, 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: Max Reitz Message-id: 20190805152840.32190-1-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/124 | 38 ++++++++++++++++++++++++++++++++++---- tests/qemu-iotests/124.out | 4 ++-- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124 index 80b356f7bb..3440f54781 100755 --- a/tests/qemu-iotests/124 +++ b/tests/qemu-iotests/124 @@ -212,25 +212,28 @@ class TestIncrementalBackupBase(iotests.QMPTestCase): return bitmap =20 =20 - def prepare_backup(self, bitmap=3DNone, parent=3DNone): + def prepare_backup(self, bitmap=3DNone, parent=3DNone, **kwargs): if bitmap is None: bitmap =3D self.bitmaps[-1] if parent is None: parent, _ =3D bitmap.last_target() =20 target, _ =3D bitmap.new_target() - self.img_create(target, bitmap.drive['fmt'], parent=3Dparent) + self.img_create(target, bitmap.drive['fmt'], parent=3Dparent, + **kwargs) return target =20 =20 def create_incremental(self, bitmap=3DNone, parent=3DNone, - parentFormat=3DNone, validate=3DTrue): + parentFormat=3DNone, validate=3DTrue, + target=3DNone): if bitmap is None: bitmap =3D self.bitmaps[-1] if parent is None: parent, _ =3D bitmap.last_target() =20 - target =3D self.prepare_backup(bitmap, parent) + if target is None: + target =3D self.prepare_backup(bitmap, parent) res =3D self.do_qmp_backup(job_id=3Dbitmap.drive['id'], device=3Dbitmap.drive['id'], sync=3D'incremental', bitmap=3Dbitmap.nam= e, @@ -572,6 +575,33 @@ class TestIncrementalBackup(TestIncrementalBackupBase): 'bitmap0', self.drives[0], granularity=3D64000) =20 + def test_growing_before_backup(self): + ''' + Test: Add a bitmap, truncate the image, write past the old + end, do a backup. + + Incremental backup should not ignore dirty bits past the old + image end. + ''' + self.assert_no_active_block_jobs() + + self.create_anchor_backup() + + self.add_bitmap('bitmap0', self.drives[0]) + + res =3D self.vm.qmp('block_resize', device=3Dself.drives[0]['id'], + size=3D(65 * 1048576)) + self.assert_qmp(res, 'return', {}) + + # Dirty the image past the old end + self.vm.hmp_qemu_io(self.drives[0]['id'], 'write 64M 64k') + + target =3D self.prepare_backup(size=3D'65M') + self.create_incremental(target=3Dtarget) + + self.vm.shutdown() + self.check_backups() + =20 class TestIncrementalBackupBlkdebug(TestIncrementalBackupBase): '''Incremental backup tests that utilize a BlkDebug filter on drive0.'= '' diff --git a/tests/qemu-iotests/124.out b/tests/qemu-iotests/124.out index 281b69efea..fa16b5ccef 100644 --- a/tests/qemu-iotests/124.out +++ b/tests/qemu-iotests/124.out @@ -1,5 +1,5 @@ -............ +............. ---------------------------------------------------------------------- -Ran 12 tests +Ran 13 tests =20 OK --=20 2.21.0 From nobody Fri May 3 23:42:06 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=1565023241; cv=none; d=zoho.com; s=zohoarc; b=au4q5opD2x/GforKrEh5gqkZiUueGQ172/mBRyom8K3tXPZttkcUuE4QVPUsoJXMGtZ6fdT/swADsuc0o10wASRg9iR17i0HBmBFhewNGC/ErdqjH2XZXGTeazjVBvMbCbd94WLuGDADrr3A0AiGGizikIIUjIeuHiGNkO79fQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565023241; 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=ezA5FC8jK3Wtoqfv5ud3I/Fvzcp3yErzjPFou+4REm8=; b=OA9stcJdAol2CqvTLKQHCpwYsO3Pe/xmTXR6NxV+jU0hsRKvtWb3l6DUuF+txMAPDjG+U44n7qMDNE6/Pi2kseGxCRRYydxE+UdxaE4F/sxkg5dFL/ZrLbdy8/SBcOpanaaLtqIX7ke412KxwGpFeWSUTtMe/+gg1p+hBVvY1zk= 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 1565023241496591.6987583206027; Mon, 5 Aug 2019 09:40:41 -0700 (PDT) Received: from localhost ([::1]:55976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hug2K-0002Bk-J2 for importer@patchew.org; Mon, 05 Aug 2019 12:40:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37558) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hufzj-00065J-1B for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:38:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hufzh-0005xm-R2 for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:37:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35098) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hufzf-0005wR-Df; Mon, 05 Aug 2019 12:37:55 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D8BD308219E; Mon, 5 Aug 2019 16:37:54 +0000 (UTC) Received: from localhost (unknown [10.40.205.217]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 37B56194B6; Mon, 5 Aug 2019 16:37:54 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 5 Aug 2019 18:37:38 +0200 Message-Id: <20190805163740.23616-6-mreitz@redhat.com> In-Reply-To: <20190805163740.23616-1-mreitz@redhat.com> References: <20190805163740.23616-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 05 Aug 2019 16:37:54 +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] [PULL 5/7] mirror: Only mirror granularity-aligned chunks 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 , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" In write-blocking mode, all writes to the top node directly go to the target. We must only mirror chunks of data that are aligned to the job's granularity, because that is how the dirty bitmap works. Therefore, the request alignment for writes must be the job's granularity (in write-blocking mode). Unfortunately, this forces all reads and writes to have the same granularity (we only need this alignment for writes to the target, not the source), but that is something to be fixed another time. Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz Message-id: 20190805153308.2657-1-mreitz@redhat.com Reviewed-by: Vladimir Sementsov-Ogievskiy Fixes: d06107ade0ce74dc39739bac80de84b51ec18546 Signed-off-by: Max Reitz --- block/mirror.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/block/mirror.c b/block/mirror.c index 8cb75fb409..9f5c59ece1 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1481,6 +1481,15 @@ static void bdrv_mirror_top_child_perm(BlockDriverSt= ate *bs, BdrvChild *c, *nshared =3D BLK_PERM_ALL; } =20 +static void bdrv_mirror_top_refresh_limits(BlockDriverState *bs, Error **e= rrp) +{ + MirrorBDSOpaque *s =3D bs->opaque; + + if (s && s->job && s->job->copy_mode =3D=3D MIRROR_COPY_MODE_WRITE_BLO= CKING) { + bs->bl.request_alignment =3D s->job->granularity; + } +} + /* Dummy node that provides consistent read to its users without requiring= it * from its backing file and that allows writes on the backing file chain.= */ static BlockDriver bdrv_mirror_top =3D { @@ -1493,6 +1502,7 @@ static BlockDriver bdrv_mirror_top =3D { .bdrv_co_block_status =3D bdrv_co_block_status_from_backing, .bdrv_refresh_filename =3D bdrv_mirror_top_refresh_filename, .bdrv_child_perm =3D bdrv_mirror_top_child_perm, + .bdrv_refresh_limits =3D bdrv_mirror_top_refresh_limits, }; =20 static BlockJob *mirror_start_job( @@ -1637,6 +1647,25 @@ static BlockJob *mirror_start_job( s->should_complete =3D true; } =20 + /* + * Must be called before we start tracking writes, but after + * + * ((MirrorBlockJob *) + * ((MirrorBDSOpaque *) + * mirror_top_bs->opaque + * )->job + * )->copy_mode + * + * has the correct value. + * (We start tracking writes as of the following + * bdrv_create_dirty_bitmap() call.) + */ + bdrv_refresh_limits(mirror_top_bs, &local_err); + if (local_err) { + error_propagate(errp, local_err); + goto fail; + } + s->dirty_bitmap =3D bdrv_create_dirty_bitmap(bs, granularity, NULL, er= rp); if (!s->dirty_bitmap) { goto fail; --=20 2.21.0 From nobody Fri May 3 23:42:06 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=1565023151; cv=none; d=zoho.com; s=zohoarc; b=Ul+nKDhKaabv+kbu362AHlWYbNgSao+OwGN2wDlX3ltLBC9VOn90FgnBSsqJ7fA+XqOMw1dJuWVXBFvuSwb99LaEfJDGF3cK93yGABP0nDvq3xxxtvyOtXmtlWzprXA7w52rxu+MQfTSSFNgsFgVy1Burllfjr8YA753jVkk3NA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565023151; 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=ylTIVdL/Dfp5P4HXcAI+gcB47cZJ97Z+lWksFDkrhE0=; b=dR3/GHbY0Hl1gsx10hdDlvecyujqs1dxaeJRKDOaywQpDDtgXVIjUsNOQB/gOZ4hG5FzFo5bNkUPPG5DMPrnjJwWLXpYlW8rVz6NHoFYa1Om/rNdS71pLbCkE78oIgUNaj4aRvG2vBqhaKpKsQ6zf8wuw7aF9j49Ctr55sQpdno= 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 1565023151290331.6678883988985; Mon, 5 Aug 2019 09:39:11 -0700 (PDT) Received: from localhost ([::1]:55954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hug0s-0007xC-BA for importer@patchew.org; Mon, 05 Aug 2019 12:39:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37584) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hufzk-0006Be-Uf for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:38:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hufzj-0005zx-Qx for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:38:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48154) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hufzh-0005xT-J0; Mon, 05 Aug 2019 12:37:57 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DEDD53083391; Mon, 5 Aug 2019 16:37:56 +0000 (UTC) Received: from localhost (unknown [10.40.205.217]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79B1960C05; Mon, 5 Aug 2019 16:37:56 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 5 Aug 2019 18:37:39 +0200 Message-Id: <20190805163740.23616-7-mreitz@redhat.com> In-Reply-To: <20190805163740.23616-1-mreitz@redhat.com> References: <20190805163740.23616-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 05 Aug 2019 16:37:56 +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] [PULL 6/7] iotests: Test unaligned blocking mirror write 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 , Peter Maydell , qemu-devel@nongnu.org, 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: Max Reitz Message-id: 20190805113526.20319-1-mreitz@redhat.com Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Max Reitz --- tests/qemu-iotests/151 | 25 +++++++++++++++++++++++++ tests/qemu-iotests/151.out | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/151 b/tests/qemu-iotests/151 index 1bb74d67c4..ad7359fc8d 100755 --- a/tests/qemu-iotests/151 +++ b/tests/qemu-iotests/151 @@ -114,6 +114,31 @@ class TestActiveMirror(iotests.QMPTestCase): def testActiveIOFlushed(self): self.doActiveIO(True) =20 + def testUnalignedActiveIO(self): + # Fill the source image + result =3D self.vm.hmp_qemu_io('source', 'write -P 1 0 2M') + + # Start the block job (very slowly) + result =3D self.vm.qmp('blockdev-mirror', + job_id=3D'mirror', + filter_node_name=3D'mirror-node', + device=3D'source-node', + target=3D'target-node', + sync=3D'full', + copy_mode=3D'write-blocking', + buf_size=3D(1048576 // 4), + speed=3D1) + self.assert_qmp(result, 'return', {}) + + # Start an unaligned request to a dirty area + result =3D self.vm.hmp_qemu_io('source', 'write -P 2 %i 1' % (1048= 576 + 42)) + + # Let the job finish + result =3D self.vm.qmp('block-job-set-speed', device=3D'mirror', s= peed=3D0) + self.assert_qmp(result, 'return', {}) + self.complete_and_wait(drive=3D'mirror') + + self.potential_writes_in_flight =3D False =20 =20 if __name__ =3D=3D '__main__': diff --git a/tests/qemu-iotests/151.out b/tests/qemu-iotests/151.out index fbc63e62f8..8d7e996700 100644 --- a/tests/qemu-iotests/151.out +++ b/tests/qemu-iotests/151.out @@ -1,5 +1,5 @@ -.. +... ---------------------------------------------------------------------- -Ran 2 tests +Ran 3 tests =20 OK --=20 2.21.0 From nobody Fri May 3 23:42:06 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=1565023330; cv=none; d=zoho.com; s=zohoarc; b=MqZMmhC6U4pQKgURFDyPXIplnRc7NznLNAyXuubJ0PURwtaok2wsTpYXNb7vd/HMkxa6KBNwxyoYkjBada1cYrB9XoDTG0kPuMlueddertY2gtryCrUE8eIkVyLYk7p05BmGyVzHVM3FhXzEt+dQOfx90c0hEcuVyGp4SrchADM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565023330; 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=V2aNpl11YXcDLurEjshf649fAjU6kck3UkN4gX/ds7s=; b=DhK+wNN74JYMsY4p71/01cMXPokFCk3br2irBk1A5B4WDSQ581lchywi9YdDfMw/S9mzsLpJcOMICCGcWJBvDWEnfWs/mpewEHganKQ222x2U9jXH21tDKcPVOzaHNx223WMocv9G8Vq5i6YBT6peROPOKg7MpBRqghEcLRLFdg= 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 1565023330378643.9431649748601; Mon, 5 Aug 2019 09:42:10 -0700 (PDT) Received: from localhost ([::1]:55994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hug3l-0004NP-Ge for importer@patchew.org; Mon, 05 Aug 2019 12:42:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37630) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hufzn-0006Ke-8I for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:38:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hufzm-00062S-7R for qemu-devel@nongnu.org; Mon, 05 Aug 2019 12:38:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34984) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hufzj-0005zC-SE; Mon, 05 Aug 2019 12:38:00 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2FB523084045; Mon, 5 Aug 2019 16:37:59 +0000 (UTC) Received: from localhost (unknown [10.40.205.217]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BDEA25C1D8; Mon, 5 Aug 2019 16:37:58 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Mon, 5 Aug 2019 18:37:40 +0200 Message-Id: <20190805163740.23616-8-mreitz@redhat.com> In-Reply-To: <20190805163740.23616-1-mreitz@redhat.com> References: <20190805163740.23616-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 05 Aug 2019 16:37:59 +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] [PULL 7/7] block/backup: disable copy_range for compressed backup 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 , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Enabled by default copy_range ignores compress option. It's definitely unexpected for user. It's broken since introduction of copy_range usage in backup in 9ded4a011496. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20190730163251.755248-3-vsementsov@virtuozzo.com Reviewed-by: John Snow Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- block/backup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/backup.c b/block/backup.c index 1ee271f9f1..b26c22c4b8 100644 --- a/block/backup.c +++ b/block/backup.c @@ -657,7 +657,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, job->cluster_size =3D cluster_size; job->copy_bitmap =3D copy_bitmap; copy_bitmap =3D NULL; - job->use_copy_range =3D true; + job->use_copy_range =3D !compress; /* compression isn't supported for = it */ job->copy_range_size =3D MIN_NON_ZERO(blk_get_max_transfer(job->common= .blk), blk_get_max_transfer(job->target)); job->copy_range_size =3D MAX(job->cluster_size, --=20 2.21.0