From nobody Fri Apr 26 07:02:52 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=1570709889; cv=none; d=zoho.com; s=zohoarc; b=TYkavZZ6c9/1ZII5uPS99SKTHX8rXsmSS/gbX0BGf9NJ/fWnA103e5FIRufKsQc/VEDrynyDRr1J3GUPOuUut9+0bfzyXrlgVpJhncA1VkwLmHyr5AMw+g20bPnZcqLSl39N0G7rrNPi06r9hz2HWIqvXqL8BZl0iNtXuVGZblM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709889; 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; bh=7x7x3Rl/IpteWIesumn8iitb6pHPT2CbgBQ1zWzL/wA=; b=Aa3KBkczvr/17QchB5zLYOlK4vmE7q1Cuev41huST71eLgWOWOBzMvr0RZQkld+CvI54a5Hr1GTDbXDtTOBiPzqGrl49M4/Bhyc7vmB5PgNtLkvyCjbJEDJZlPdD3wLYfmzsy7eJWTExJeRhKVyvfyaCl3KrhYcR/Uz76tpcOnk= 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 1570709889344290.06330835309325; Thu, 10 Oct 2019 05:18:09 -0700 (PDT) Received: from localhost ([::1]:37032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXOR-0002E0-J3 for importer@patchew.org; Thu, 10 Oct 2019 08:18:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51623) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWqj-0006HO-Ay for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWqg-00084Y-6m for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43082) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqX-00081N-Vo; Thu, 10 Oct 2019 07:43:07 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F0CF0C059B80; Thu, 10 Oct 2019 11:43:04 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 40D4360920; Thu, 10 Oct 2019 11:43:04 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 01/36] qemu-iotests: ignore leaks on failure paths in 026 Date: Thu, 10 Oct 2019 13:42:25 +0200 Message-Id: <20191010114300.7746-2-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 10 Oct 2019 11:43:05 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Upcoming asynchronous handling of sub-parts of qcow2 requests will change number of leaked clusters and even make it racy. As a preparation, ignore leaks on failure parts in 026. It's not trivial to just grep or substitute qemu-img output for such thing. Instead do better: 3 is a error code of qemu-img check, if only leaks are found. Catch this case and print success output. Suggested-by: Anton Nefedov Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20190916175324.18478-2-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- tests/qemu-iotests/026 | 6 +-- tests/qemu-iotests/026.out | 80 ++++++++---------------------- tests/qemu-iotests/026.out.nocache | 80 ++++++++---------------------- tests/qemu-iotests/common.rc | 17 +++++++ 4 files changed, 60 insertions(+), 123 deletions(-) diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026 index ffb18ab6b5..3430029ed6 100755 --- a/tests/qemu-iotests/026 +++ b/tests/qemu-iotests/026 @@ -107,7 +107,7 @@ if [ "$event" =3D=3D "l2_load" ]; then $QEMU_IO -c "read $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu_= io fi =20 -_check_test_img 2>&1 | grep -v "refcount=3D1 reference=3D0" +_check_test_img_ignore_leaks 2>&1 | grep -v "refcount=3D1 reference=3D0" =20 done done @@ -152,7 +152,7 @@ echo echo "Event: $event; errno: $errno; imm: $imm; once: $once; write $vmstate" $QEMU_IO -c "write $vmstate 0 64M" "$BLKDBG_TEST_IMG" | _filter_qemu_io =20 -_check_test_img 2>&1 | grep -v "refcount=3D1 reference=3D0" +_check_test_img_ignore_leaks 2>&1 | grep -v "refcount=3D1 reference=3D0" =20 done done @@ -191,7 +191,7 @@ echo echo "Event: $event; errno: $errno; imm: $imm; once: $once" $QEMU_IO -c "write -b 0 64k" "$BLKDBG_TEST_IMG" | _filter_qemu_io =20 -_check_test_img 2>&1 | grep -v "refcount=3D1 reference=3D0" +_check_test_img_ignore_leaks 2>&1 | grep -v "refcount=3D1 reference=3D0" =20 done done diff --git a/tests/qemu-iotests/026.out b/tests/qemu-iotests/026.out index fb89b8480c..ff0817b6f2 100644 --- a/tests/qemu-iotests/026.out +++ b/tests/qemu-iotests/026.out @@ -17,18 +17,14 @@ Event: l1_update; errno: 5; imm: off; once: off; write qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: l1_update; errno: 5; imm: off; once: off; write -b qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: l1_update; errno: 28; imm: off; once: on; write @@ -45,18 +41,14 @@ Event: l1_update; errno: 28; imm: off; once: off; write qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: l1_update; errno: 28; imm: off; once: off; write -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: l2_load; errno: 5; imm: off; once: on; write @@ -137,18 +129,14 @@ Event: l2_update; errno: 5; imm: off; once: off; write qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error - -127 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: l2_update; errno: 5; imm: off; once: off; write -b qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error - -127 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: l2_update; errno: 28; imm: off; once: on; write @@ -165,18 +153,14 @@ Event: l2_update; errno: 28; imm: off; once: off; wri= te qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -127 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: l2_update; errno: 28; imm: off; once: off; write -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -127 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: l2_alloc_write; errno: 5; imm: off; once: on; write @@ -200,9 +184,7 @@ Event: l2_alloc_write; errno: 5; imm: off; once: off; w= rite -b qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: l2_alloc_write; errno: 28; imm: off; once: on; write @@ -226,9 +208,7 @@ Event: l2_alloc_write; errno: 28; imm: off; once: off; = write -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: write_aio; errno: 5; imm: off; once: on; write @@ -480,18 +460,14 @@ Event: refblock_alloc_hookup; errno: 28; imm: off; on= ce: off; write qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -55 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: refblock_alloc_hookup; errno: 28; imm: off; once: off; write -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -251 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: refblock_alloc_write; errno: 28; imm: off; once: on; write @@ -532,18 +508,14 @@ Event: refblock_alloc_write_blocks; errno: 28; imm: o= ff; once: off; write qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -10 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: off; write = -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -23 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: refblock_alloc_write_table; errno: 28; imm: off; once: on; write @@ -560,18 +532,14 @@ Event: refblock_alloc_write_table; errno: 28; imm: of= f; once: off; write qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -10 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: refblock_alloc_write_table; errno: 28; imm: off; once: off; write -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -23 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: on; write @@ -588,18 +556,14 @@ Event: refblock_alloc_switch_table; errno: 28; imm: o= ff; once: off; write qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -10 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: off; write = -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -23 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. =20 =3D=3D=3D L1 growth tests =3D=3D=3D =20 @@ -658,9 +622,7 @@ Event: l1_grow_activate_table; errno: 5; imm: off; once= : off qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error - -96 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 =20 Event: l1_grow_activate_table; errno: 28; imm: off; once: on @@ -672,9 +634,7 @@ Event: l1_grow_activate_table; errno: 28; imm: off; onc= e: off qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -96 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. =20 =3D=3D=3D Avoid cluster leaks after temporary failure =3D=3D=3D =20 diff --git a/tests/qemu-iotests/026.out.nocache b/tests/qemu-iotests/026.ou= t.nocache index 6dda95dfb4..495d013007 100644 --- a/tests/qemu-iotests/026.out.nocache +++ b/tests/qemu-iotests/026.out.nocache @@ -17,18 +17,14 @@ Event: l1_update; errno: 5; imm: off; once: off; write qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: l1_update; errno: 5; imm: off; once: off; write -b qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: l1_update; errno: 28; imm: off; once: on; write=20 @@ -45,18 +41,14 @@ Event: l1_update; errno: 28; imm: off; once: off; write qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: l1_update; errno: 28; imm: off; once: off; write -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: l2_load; errno: 5; imm: off; once: on; write=20 @@ -140,9 +132,7 @@ qemu-io: Failed to flush the L2 table cache: Input/outp= ut error qemu-io: Failed to flush the refcount block cache: Input/output error wrote 131072/131072 bytes at offset 0 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) - -127 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: l2_update; errno: 5; imm: off; once: off; write -b @@ -150,9 +140,7 @@ qemu-io: Failed to flush the L2 table cache: Input/outp= ut error qemu-io: Failed to flush the refcount block cache: Input/output error wrote 131072/131072 bytes at offset 0 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) - -127 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: l2_update; errno: 28; imm: off; once: on; write=20 @@ -172,9 +160,7 @@ qemu-io: Failed to flush the L2 table cache: No space l= eft on device qemu-io: Failed to flush the refcount block cache: No space left on device wrote 131072/131072 bytes at offset 0 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) - -127 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: l2_update; errno: 28; imm: off; once: off; write -b @@ -182,9 +168,7 @@ qemu-io: Failed to flush the L2 table cache: No space l= eft on device qemu-io: Failed to flush the refcount block cache: No space left on device wrote 131072/131072 bytes at offset 0 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) - -127 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: l2_alloc_write; errno: 5; imm: off; once: on; write=20 @@ -208,9 +192,7 @@ Event: l2_alloc_write; errno: 5; imm: off; once: off; w= rite -b qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: l2_alloc_write; errno: 28; imm: off; once: on; write=20 @@ -234,9 +216,7 @@ Event: l2_alloc_write; errno: 28; imm: off; once: off; = write -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -1 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: write_aio; errno: 5; imm: off; once: on; write=20 @@ -488,18 +468,14 @@ Event: refblock_alloc_hookup; errno: 28; imm: off; on= ce: off; write qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -55 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: refblock_alloc_hookup; errno: 28; imm: off; once: off; write -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -251 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: refblock_alloc_write; errno: 28; imm: off; once: on; write=20 @@ -540,18 +516,14 @@ Event: refblock_alloc_write_blocks; errno: 28; imm: o= ff; once: off; write qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -10 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: off; write = -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -23 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: refblock_alloc_write_table; errno: 28; imm: off; once: on; write=20 @@ -568,18 +540,14 @@ Event: refblock_alloc_write_table; errno: 28; imm: of= f; once: off; write qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -10 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: refblock_alloc_write_table; errno: 28; imm: off; once: off; write -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -23 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: on; write=20 @@ -596,18 +564,14 @@ Event: refblock_alloc_switch_table; errno: 28; imm: o= ff; once: off; write qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -10 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: off; write = -b qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -23 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. =20 =3D=3D=3D L1 growth tests =3D=3D=3D =20 @@ -666,9 +630,7 @@ Event: l1_grow_activate_table; errno: 5; imm: off; once= : off qemu-io: Failed to flush the L2 table cache: Input/output error qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error - -96 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824=20 =20 Event: l1_grow_activate_table; errno: 28; imm: off; once: on @@ -680,9 +642,7 @@ Event: l1_grow_activate_table; errno: 28; imm: off; onc= e: off qemu-io: Failed to flush the L2 table cache: No space left on device qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device - -96 leaked clusters were found on the image. -This means waste of disk space, but no harm to data. +No errors were found on the image. =20 =3D=3D=3D Avoid cluster leaks after temporary failure =3D=3D=3D =20 diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index e45cdfa66b..12b4751848 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -405,6 +405,23 @@ _check_test_img() $QEMU_IMG check "$@" -f $IMGFMT "$TEST_IMG" 2>&1 fi ) | _filter_testdir | _filter_qemu_img_check + + # return real qemu_img check status, to analyze in + # _check_test_img_ignore_leaks + return ${PIPESTATUS[0]} +} + +_check_test_img_ignore_leaks() +{ + out=3D$(_check_test_img "$@") + status=3D$? + if [ $status =3D 3 ]; then + # This must correspond to success output in dump_human_image_check= () + echo "No errors were found on the image." + return 0 + fi + echo "$out" + return $status } =20 _img_info() --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709526; cv=none; d=zoho.com; s=zohoarc; b=HTOOhI1t7U3G9Q2bVQ9vPlpjTlpv18Fto+YHaRcKmcXY1EpkIx1QibV8YlW7eCUDlh5g3iy/OfujK59p0j5EUygyo/mt4zxqxDBjsMXgmEtIK06WnF4EKl6QXyEwDCBcrG1xocXfot6KTYVaq/VlcPRyQGpa+vYzAL3r0ra0FaY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709526; 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; bh=TNlIgVB/LtB8j/DOyPDLxgrL9LU2/bZIIF02LKlkzQ8=; b=X7F9z3thbsEKnzh1u3c2h3rCCkrc8y44wpSD1CnQfdtQRg9Lv/oaYqB0cuDsVeAZ8+NqIkZV4lp2GZu8Zva/8mE7QbuTnQ5+H7BbFro3qybfR/25pQ122Ur560DS0lLgSo7wH9cO2s0DQvkqvty20P1Yeb319lxd6UXyYSHIStE= 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 1570709526437231.33278898053618; Thu, 10 Oct 2019 05:12:06 -0700 (PDT) Received: from localhost ([::1]:36970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXIa-0004oy-OE for importer@patchew.org; Thu, 10 Oct 2019 08:12:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51587) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWqh-0006DN-0A for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWqf-000841-96 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38996) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqb-00081r-O7; Thu, 10 Oct 2019 07:43:10 -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 49BE883F3D; Thu, 10 Oct 2019 11:43:07 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA18710013A1; Thu, 10 Oct 2019 11:43:06 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 02/36] block: introduce aio task pool Date: Thu, 10 Oct 2019 13:42:26 +0200 Message-Id: <20191010114300.7746-3-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.27]); Thu, 10 Oct 2019 11:43:07 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Common interface for aio task loops. To be used for improving performance of synchronous io loops in qcow2, block-stream, copy-on-read, and may be other places. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190916175324.18478-3-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/Makefile.objs | 2 + include/block/aio_task.h | 54 +++++++++++++++++ block/aio_task.c | 124 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 180 insertions(+) create mode 100644 include/block/aio_task.h create mode 100644 block/aio_task.c diff --git a/block/Makefile.objs b/block/Makefile.objs index 35f3bca4d9..c2eb8c8769 100644 --- a/block/Makefile.objs +++ b/block/Makefile.objs @@ -40,6 +40,8 @@ block-obj-y +=3D throttle.o copy-on-read.o =20 block-obj-y +=3D crypto.o =20 +block-obj-y +=3D aio_task.o + common-obj-y +=3D stream.o =20 nfs.o-libs :=3D $(LIBNFS_LIBS) diff --git a/include/block/aio_task.h b/include/block/aio_task.h new file mode 100644 index 0000000000..50bc1e1817 --- /dev/null +++ b/include/block/aio_task.h @@ -0,0 +1,54 @@ +/* + * Aio tasks loops + * + * Copyright (c) 2019 Virtuozzo International GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#ifndef BLOCK_AIO_TASK_H +#define BLOCK_AIO_TASK_H + +#include "qemu/coroutine.h" + +typedef struct AioTaskPool AioTaskPool; +typedef struct AioTask AioTask; +typedef int coroutine_fn (*AioTaskFunc)(AioTask *task); +struct AioTask { + AioTaskPool *pool; + AioTaskFunc func; + int ret; +}; + +AioTaskPool *coroutine_fn aio_task_pool_new(int max_busy_tasks); +void aio_task_pool_free(AioTaskPool *); + +/* error code of failed task or 0 if all is OK */ +int aio_task_pool_status(AioTaskPool *pool); + +bool aio_task_pool_empty(AioTaskPool *pool); + +/* User provides filled @task, however task->pool will be set automaticall= y */ +void coroutine_fn aio_task_pool_start_task(AioTaskPool *pool, AioTask *tas= k); + +void coroutine_fn aio_task_pool_wait_slot(AioTaskPool *pool); +void coroutine_fn aio_task_pool_wait_one(AioTaskPool *pool); +void coroutine_fn aio_task_pool_wait_all(AioTaskPool *pool); + +#endif /* BLOCK_AIO_TASK_H */ diff --git a/block/aio_task.c b/block/aio_task.c new file mode 100644 index 0000000000..88989fa248 --- /dev/null +++ b/block/aio_task.c @@ -0,0 +1,124 @@ +/* + * Aio tasks loops + * + * Copyright (c) 2019 Virtuozzo International GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#include "qemu/osdep.h" +#include "block/aio.h" +#include "block/aio_task.h" + +struct AioTaskPool { + Coroutine *main_co; + int status; + int max_busy_tasks; + int busy_tasks; + bool waiting; +}; + +static void coroutine_fn aio_task_co(void *opaque) +{ + AioTask *task =3D opaque; + AioTaskPool *pool =3D task->pool; + + assert(pool->busy_tasks < pool->max_busy_tasks); + pool->busy_tasks++; + + task->ret =3D task->func(task); + + pool->busy_tasks--; + + if (task->ret < 0 && pool->status =3D=3D 0) { + pool->status =3D task->ret; + } + + g_free(task); + + if (pool->waiting) { + pool->waiting =3D false; + aio_co_wake(pool->main_co); + } +} + +void coroutine_fn aio_task_pool_wait_one(AioTaskPool *pool) +{ + assert(pool->busy_tasks > 0); + assert(qemu_coroutine_self() =3D=3D pool->main_co); + + pool->waiting =3D true; + qemu_coroutine_yield(); + + assert(!pool->waiting); + assert(pool->busy_tasks < pool->max_busy_tasks); +} + +void coroutine_fn aio_task_pool_wait_slot(AioTaskPool *pool) +{ + if (pool->busy_tasks < pool->max_busy_tasks) { + return; + } + + aio_task_pool_wait_one(pool); +} + +void coroutine_fn aio_task_pool_wait_all(AioTaskPool *pool) +{ + while (pool->busy_tasks > 0) { + aio_task_pool_wait_one(pool); + } +} + +void coroutine_fn aio_task_pool_start_task(AioTaskPool *pool, AioTask *tas= k) +{ + aio_task_pool_wait_slot(pool); + + task->pool =3D pool; + qemu_coroutine_enter(qemu_coroutine_create(aio_task_co, task)); +} + +AioTaskPool *coroutine_fn aio_task_pool_new(int max_busy_tasks) +{ + AioTaskPool *pool =3D g_new0(AioTaskPool, 1); + + pool->main_co =3D qemu_coroutine_self(); + pool->max_busy_tasks =3D max_busy_tasks; + + return pool; +} + +void aio_task_pool_free(AioTaskPool *pool) +{ + g_free(pool); +} + +int aio_task_pool_status(AioTaskPool *pool) +{ + if (!pool) { + return 0; /* Sugar for lazy allocation of aio pool */ + } + + return pool->status; +} + +bool aio_task_pool_empty(AioTaskPool *pool) +{ + return pool->busy_tasks =3D=3D 0; +} --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709449; cv=none; d=zoho.com; s=zohoarc; b=H7Jv7IYtHtkE4jM2m4E8U9RKUvfrK7CgmGi4NQ8vP2EbQ34D2LeODMX7fvA+iX7XrsQcUmeJ3U0MFrZHORZe7ZBjPOOoHuhYlt2gUpGF/xwoNeQNJfdNs+N1KWZG6Y1HnvP3D+h3ArqlvI+jQRvqgNKaWtN+DvPUm1qpvAbb9nI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709449; 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; bh=NDj9dRXo3WRf+Jn3Id1MlQFxU55hMHcf7+mbPs8uiJs=; b=lkfXre7sRxZOmSwQbOMy1BnRZ+QdQG9kRWU7KeWQgmO8PQoOEhXdvmXvjkYJ8Iw3s53BUCASQaioZHaWAY0SNNgophHVsqSl3kZJsi0hjO6ZDbJKjQmrFyQ9mR9/kZYRpdNm5TlTyPhQQBBRPcOoSeHdbbra4gUKTAmzmS2aluE= 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 1570709449132975.8954414212965; Thu, 10 Oct 2019 05:10:49 -0700 (PDT) Received: from localhost ([::1]:36958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXHG-000333-2s for importer@patchew.org; Thu, 10 Oct 2019 08:10:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51593) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWqh-0006E7-EV for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWqf-00084J-Pn for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33050) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqc-00082N-As; Thu, 10 Oct 2019 07:43:10 -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 8AE22307D88C; Thu, 10 Oct 2019 11:43:09 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01D9E5D6A5; Thu, 10 Oct 2019 11:43:08 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 03/36] block/qcow2: refactor qcow2_co_preadv_part Date: Thu, 10 Oct 2019 13:42:27 +0200 Message-Id: <20191010114300.7746-4-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.48]); Thu, 10 Oct 2019 11:43:09 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Further patch will run partial requests of iterations of qcow2_co_preadv in parallel for performance reasons. To prepare for this, separate part which may be parallelized into separate function (qcow2_co_preadv_task). While being here, also separate encrypted clusters reading to own function, like it is done for compressed reading. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190916175324.18478-4-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/qcow2.c | 209 +++++++++++++++++++++++++++----------------------- 1 file changed, 113 insertions(+), 96 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 4d16393e61..6feb169f7c 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1972,17 +1972,117 @@ out: return ret; } =20 +static coroutine_fn int +qcow2_co_preadv_encrypted(BlockDriverState *bs, + uint64_t file_cluster_offset, + uint64_t offset, + uint64_t bytes, + QEMUIOVector *qiov, + uint64_t qiov_offset) +{ + int ret; + BDRVQcow2State *s =3D bs->opaque; + uint8_t *buf; + + assert(bs->encrypted && s->crypto); + assert(bytes <=3D QCOW_MAX_CRYPT_CLUSTERS * s->cluster_size); + + /* + * For encrypted images, read everything into a temporary + * contiguous buffer on which the AES functions can work. + * Also, decryption in a separate buffer is better as it + * prevents the guest from learning information about the + * encrypted nature of the virtual disk. + */ + + buf =3D qemu_try_blockalign(s->data_file->bs, bytes); + if (buf =3D=3D NULL) { + return -ENOMEM; + } + + BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); + ret =3D bdrv_co_pread(s->data_file, + file_cluster_offset + offset_into_cluster(s, offse= t), + bytes, buf, 0); + if (ret < 0) { + goto fail; + } + + assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); + assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); + if (qcow2_co_decrypt(bs, + file_cluster_offset + offset_into_cluster(s, offs= et), + offset, buf, bytes) < 0) + { + ret =3D -EIO; + goto fail; + } + qemu_iovec_from_buf(qiov, qiov_offset, buf, bytes); + +fail: + qemu_vfree(buf); + + return ret; +} + +static coroutine_fn int qcow2_co_preadv_task(BlockDriverState *bs, + QCow2ClusterType cluster_type, + uint64_t file_cluster_offset, + uint64_t offset, uint64_t byt= es, + QEMUIOVector *qiov, + size_t qiov_offset) +{ + BDRVQcow2State *s =3D bs->opaque; + int offset_in_cluster =3D offset_into_cluster(s, offset); + + switch (cluster_type) { + case QCOW2_CLUSTER_ZERO_PLAIN: + case QCOW2_CLUSTER_ZERO_ALLOC: + /* Both zero types are handled in qcow2_co_preadv_part */ + g_assert_not_reached(); + + case QCOW2_CLUSTER_UNALLOCATED: + assert(bs->backing); /* otherwise handled in qcow2_co_preadv_part = */ + + BLKDBG_EVENT(bs->file, BLKDBG_READ_BACKING_AIO); + return bdrv_co_preadv_part(bs->backing, offset, bytes, + qiov, qiov_offset, 0); + + case QCOW2_CLUSTER_COMPRESSED: + return qcow2_co_preadv_compressed(bs, file_cluster_offset, + offset, bytes, qiov, qiov_offset= ); + + case QCOW2_CLUSTER_NORMAL: + if ((file_cluster_offset & 511) !=3D 0) { + return -EIO; + } + + if (bs->encrypted) { + return qcow2_co_preadv_encrypted(bs, file_cluster_offset, + offset, bytes, qiov, qiov_off= set); + } + + BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); + return bdrv_co_preadv_part(s->data_file, + file_cluster_offset + offset_in_cluster, + bytes, qiov, qiov_offset, 0); + + default: + g_assert_not_reached(); + } + + g_assert_not_reached(); +} + static coroutine_fn int qcow2_co_preadv_part(BlockDriverState *bs, uint64_t offset, uint64_t byt= es, QEMUIOVector *qiov, size_t qiov_offset, int flags) { BDRVQcow2State *s =3D bs->opaque; - int offset_in_cluster; int ret; unsigned int cur_bytes; /* number of bytes in current iteration */ uint64_t cluster_offset =3D 0; - uint8_t *cluster_data =3D NULL; =20 while (bytes !=3D 0) { =20 @@ -1997,112 +2097,29 @@ static coroutine_fn int qcow2_co_preadv_part(Block= DriverState *bs, ret =3D qcow2_get_cluster_offset(bs, offset, &cur_bytes, &cluster_= offset); qemu_co_mutex_unlock(&s->lock); if (ret < 0) { - goto fail; + return ret; } =20 - offset_in_cluster =3D offset_into_cluster(s, offset); - - switch (ret) { - case QCOW2_CLUSTER_UNALLOCATED: - - if (bs->backing) { - BLKDBG_EVENT(bs->file, BLKDBG_READ_BACKING_AIO); - ret =3D bdrv_co_preadv_part(bs->backing, offset, cur_bytes, - qiov, qiov_offset, 0); - if (ret < 0) { - goto fail; - } - } else { - /* Note: in this case, no need to wait */ - qemu_iovec_memset(qiov, qiov_offset, 0, cur_bytes); - } - break; - - case QCOW2_CLUSTER_ZERO_PLAIN: - case QCOW2_CLUSTER_ZERO_ALLOC: + if (ret =3D=3D QCOW2_CLUSTER_ZERO_PLAIN || + ret =3D=3D QCOW2_CLUSTER_ZERO_ALLOC || + (ret =3D=3D QCOW2_CLUSTER_UNALLOCATED && !bs->backing)) + { qemu_iovec_memset(qiov, qiov_offset, 0, cur_bytes); - break; - - case QCOW2_CLUSTER_COMPRESSED: - ret =3D qcow2_co_preadv_compressed(bs, cluster_offset, - offset, cur_bytes, - qiov, qiov_offset); + } else { + ret =3D qcow2_co_preadv_task(bs, ret, + cluster_offset, offset, cur_bytes, + qiov, qiov_offset); if (ret < 0) { - goto fail; - } - - break; - - case QCOW2_CLUSTER_NORMAL: - if ((cluster_offset & 511) !=3D 0) { - ret =3D -EIO; - goto fail; - } - - if (bs->encrypted) { - assert(s->crypto); - - /* - * For encrypted images, read everything into a temporary - * contiguous buffer on which the AES functions can work. - */ - if (!cluster_data) { - cluster_data =3D - qemu_try_blockalign(s->data_file->bs, - QCOW_MAX_CRYPT_CLUSTERS - * s->cluster_size); - if (cluster_data =3D=3D NULL) { - ret =3D -ENOMEM; - goto fail; - } - } - - assert(cur_bytes <=3D QCOW_MAX_CRYPT_CLUSTERS * s->cluster= _size); - - BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); - ret =3D bdrv_co_pread(s->data_file, - cluster_offset + offset_in_cluster, - cur_bytes, cluster_data, 0); - if (ret < 0) { - goto fail; - } - - assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); - assert(QEMU_IS_ALIGNED(cur_bytes, BDRV_SECTOR_SIZE)); - if (qcow2_co_decrypt(bs, cluster_offset + offset_in_cluste= r, - offset, - cluster_data, cur_bytes) < 0) { - ret =3D -EIO; - goto fail; - } - qemu_iovec_from_buf(qiov, qiov_offset, cluster_data, cur_b= ytes); - } else { - BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); - ret =3D bdrv_co_preadv_part(s->data_file, - cluster_offset + offset_in_clust= er, - cur_bytes, qiov, qiov_offset, 0); - if (ret < 0) { - goto fail; - } + return ret; } - break; - - default: - g_assert_not_reached(); - ret =3D -EIO; - goto fail; } =20 bytes -=3D cur_bytes; offset +=3D cur_bytes; qiov_offset +=3D cur_bytes; } - ret =3D 0; - -fail: - qemu_vfree(cluster_data); =20 - return ret; + return 0; } =20 /* Check if it's possible to merge a write request with the writing of --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709637; cv=none; d=zoho.com; s=zohoarc; b=iWO4gS2gh5JnqGi4kJ/IdT8tGMiA7WNnGwwX7dfsrQlRMEnbNMgAdseb8vBRHlYk5m99I+Flk2poI2MzBpnO3op1qSB3nddaFOAMZqDYGGc0TJr3ePnue7dv1I+HFN6PyURHqmUoVfIvQ2kIgtc+WbMv2APCCSJAzgs74mtbP0I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709637; 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; bh=y2lHoqcawHZfEf3AhFyIhZsTEagKYvJ2k/WA2oWaCa0=; b=c2Yk5IgIsi6G2dGpHlEeP37hC36cT71d3Dlb8qKVGWx1QVFPXySDr1kol1kOihve27EQwjgnmRsW2K5RzDM6gEl3uJmtYz9QwhhfS0bZUcIY3StOxT/1FTTOE92vVJugZPX0SikLwCgs7tJAkcr27vfFm8biwU6nGzuORtXTCEc= 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 1570709637606510.1424008763074; Thu, 10 Oct 2019 05:13:57 -0700 (PDT) Received: from localhost ([::1]:36996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXKO-0006qJ-2v for importer@patchew.org; Thu, 10 Oct 2019 08:13:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51622) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWqj-0006HN-Dh for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWqh-00085F-S1 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59368) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqe-00083b-Io; Thu, 10 Oct 2019 07:43:12 -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 C6B18308FE8F; Thu, 10 Oct 2019 11:43:11 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41EC75DAAC; Thu, 10 Oct 2019 11:43:11 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 04/36] block/qcow2: refactor qcow2_co_pwritev_part Date: Thu, 10 Oct 2019 13:42:28 +0200 Message-Id: <20191010114300.7746-5-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.49]); Thu, 10 Oct 2019 11:43:11 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Similarly to previous commit, prepare for parallelizing write-loop iterations. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190916175324.18478-5-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/qcow2.c | 154 +++++++++++++++++++++++++++++--------------------- 1 file changed, 90 insertions(+), 64 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 6feb169f7c..164b22e4a2 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2242,6 +2242,88 @@ static int handle_alloc_space(BlockDriverState *bs, = QCowL2Meta *l2meta) return 0; } =20 +/* + * qcow2_co_pwritev_task + * Called with s->lock unlocked + * l2meta - if not NULL, qcow2_co_pwritev_task() will consume it. Caller = must + * not use it somehow after qcow2_co_pwritev_task() call + */ +static coroutine_fn int qcow2_co_pwritev_task(BlockDriverState *bs, + uint64_t file_cluster_offset, + uint64_t offset, uint64_t by= tes, + QEMUIOVector *qiov, + uint64_t qiov_offset, + QCowL2Meta *l2meta) +{ + int ret; + BDRVQcow2State *s =3D bs->opaque; + void *crypt_buf =3D NULL; + int offset_in_cluster =3D offset_into_cluster(s, offset); + QEMUIOVector encrypted_qiov; + + if (bs->encrypted) { + assert(s->crypto); + assert(bytes <=3D QCOW_MAX_CRYPT_CLUSTERS * s->cluster_size); + crypt_buf =3D qemu_try_blockalign(bs->file->bs, bytes); + if (crypt_buf =3D=3D NULL) { + ret =3D -ENOMEM; + goto out_unlocked; + } + qemu_iovec_to_buf(qiov, qiov_offset, crypt_buf, bytes); + + if (qcow2_co_encrypt(bs, file_cluster_offset + offset_in_cluster, + offset, crypt_buf, bytes) < 0) + { + ret =3D -EIO; + goto out_unlocked; + } + + qemu_iovec_init_buf(&encrypted_qiov, crypt_buf, bytes); + qiov =3D &encrypted_qiov; + qiov_offset =3D 0; + } + + /* Try to efficiently initialize the physical space with zeroes */ + ret =3D handle_alloc_space(bs, l2meta); + if (ret < 0) { + goto out_unlocked; + } + + /* + * If we need to do COW, check if it's possible to merge the + * writing of the guest data together with that of the COW regions. + * If it's not possible (or not necessary) then write the + * guest data now. + */ + if (!merge_cow(offset, bytes, qiov, qiov_offset, l2meta)) { + BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO); + trace_qcow2_writev_data(qemu_coroutine_self(), + file_cluster_offset + offset_in_cluster); + ret =3D bdrv_co_pwritev_part(s->data_file, + file_cluster_offset + offset_in_cluster, + bytes, qiov, qiov_offset, 0); + if (ret < 0) { + goto out_unlocked; + } + } + + qemu_co_mutex_lock(&s->lock); + + ret =3D qcow2_handle_l2meta(bs, &l2meta, true); + goto out_locked; + +out_unlocked: + qemu_co_mutex_lock(&s->lock); + +out_locked: + qcow2_handle_l2meta(bs, &l2meta, false); + qemu_co_mutex_unlock(&s->lock); + + qemu_vfree(crypt_buf); + + return ret; +} + static coroutine_fn int qcow2_co_pwritev_part( BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, int flags) @@ -2251,15 +2333,10 @@ static coroutine_fn int qcow2_co_pwritev_part( int ret; unsigned int cur_bytes; /* number of sectors in current iteration */ uint64_t cluster_offset; - QEMUIOVector encrypted_qiov; - uint64_t bytes_done =3D 0; - uint8_t *cluster_data =3D NULL; QCowL2Meta *l2meta =3D NULL; =20 trace_qcow2_writev_start_req(qemu_coroutine_self(), offset, bytes); =20 - qemu_co_mutex_lock(&s->lock); - while (bytes !=3D 0) { =20 l2meta =3D NULL; @@ -2273,6 +2350,8 @@ static coroutine_fn int qcow2_co_pwritev_part( - offset_in_cluster); } =20 + qemu_co_mutex_lock(&s->lock); + ret =3D qcow2_alloc_cluster_offset(bs, offset, &cur_bytes, &cluster_offset, &l2meta); if (ret < 0) { @@ -2290,73 +2369,20 @@ static coroutine_fn int qcow2_co_pwritev_part( =20 qemu_co_mutex_unlock(&s->lock); =20 - if (bs->encrypted) { - assert(s->crypto); - if (!cluster_data) { - cluster_data =3D qemu_try_blockalign(bs->file->bs, - QCOW_MAX_CRYPT_CLUSTERS - * s->cluster_size); - if (cluster_data =3D=3D NULL) { - ret =3D -ENOMEM; - goto out_unlocked; - } - } - - assert(cur_bytes <=3D QCOW_MAX_CRYPT_CLUSTERS * s->cluster_siz= e); - qemu_iovec_to_buf(qiov, qiov_offset + bytes_done, - cluster_data, cur_bytes); - - if (qcow2_co_encrypt(bs, cluster_offset + offset_in_cluster, o= ffset, - cluster_data, cur_bytes) < 0) { - ret =3D -EIO; - goto out_unlocked; - } - - qemu_iovec_init_buf(&encrypted_qiov, cluster_data, cur_bytes); - } - - /* Try to efficiently initialize the physical space with zeroes */ - ret =3D handle_alloc_space(bs, l2meta); + ret =3D qcow2_co_pwritev_task(bs, cluster_offset, offset, cur_byte= s, + qiov, qiov_offset, l2meta); + l2meta =3D NULL; /* l2meta is consumed by qcow2_co_pwritev_task() = */ if (ret < 0) { - goto out_unlocked; - } - - /* If we need to do COW, check if it's possible to merge the - * writing of the guest data together with that of the COW regions. - * If it's not possible (or not necessary) then write the - * guest data now. */ - if (!merge_cow(offset, cur_bytes, - bs->encrypted ? &encrypted_qiov : qiov, - bs->encrypted ? 0 : qiov_offset + bytes_done, l2met= a)) - { - BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO); - trace_qcow2_writev_data(qemu_coroutine_self(), - cluster_offset + offset_in_cluster); - ret =3D bdrv_co_pwritev_part( - s->data_file, cluster_offset + offset_in_cluster, cur_= bytes, - bs->encrypted ? &encrypted_qiov : qiov, - bs->encrypted ? 0 : qiov_offset + bytes_done, 0); - if (ret < 0) { - goto out_unlocked; - } - } - - qemu_co_mutex_lock(&s->lock); - - ret =3D qcow2_handle_l2meta(bs, &l2meta, true); - if (ret) { - goto out_locked; + goto fail_nometa; } =20 bytes -=3D cur_bytes; offset +=3D cur_bytes; - bytes_done +=3D cur_bytes; + qiov_offset +=3D cur_bytes; trace_qcow2_writev_done_part(qemu_coroutine_self(), cur_bytes); } ret =3D 0; - goto out_locked; =20 -out_unlocked: qemu_co_mutex_lock(&s->lock); =20 out_locked: @@ -2364,7 +2390,7 @@ out_locked: =20 qemu_co_mutex_unlock(&s->lock); =20 - qemu_vfree(cluster_data); +fail_nometa: trace_qcow2_writev_done_req(qemu_coroutine_self(), ret); =20 return ret; --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710033; cv=none; d=zoho.com; s=zohoarc; b=XwVMMoMeFW91TuTrSCLSXHovMlSHdjoaGGBvLpmC9AqcO1uVHE04nDPe2V9nzoKDeQEa3EK096iBXVAYOMFCebMw5u3E6a0OAtcpIvzmW4qWTOR7vctcgodTNuiUOZFZyvbNECZYTxbfWm+y1jWJNnm9jQw7AoxPdEDhZGTDrPI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710033; 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; bh=+CLC4kla5bh/GxYqwzNgoZymKi3B7cs7MiAG/nmlJxw=; b=OWM6O9/JgYRWNjZur8hTJ2t5jvzGMRmguipvowiBWsQGRI6wvcOiPmn1thQoz3LZDggrQgbGxU5MOiobTairojBVmq7vFoFK4yxMGmjUzt1tHowDEas2gQ0wdjqhkcyoKbOHrhuJ/ck8KI9OfaPTbfnLdIwM90CogzCBxWw0H3A= 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 1570710033659514.8507932962382; Thu, 10 Oct 2019 05:20:33 -0700 (PDT) Received: from localhost ([::1]:37064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXQl-00067X-WC for importer@patchew.org; Thu, 10 Oct 2019 08:20:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51655) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWql-0006LR-Pw for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWqk-000866-7R for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50994) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqg-00084e-Rg; Thu, 10 Oct 2019 07:43:15 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16B756908B; Thu, 10 Oct 2019 11:43:14 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85A5B60A9F; Thu, 10 Oct 2019 11:43:13 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 05/36] block/qcow2: introduce parallel subrequest handling in read and write Date: Thu, 10 Oct 2019 13:42:29 +0200 Message-Id: <20191010114300.7746-6-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 10 Oct 2019 11:43:14 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 It improves performance for fragmented qcow2 images. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20190916175324.18478-6-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/qcow2.h | 3 ++ block/qcow2.c | 125 ++++++++++++++++++++++++++++++++++++++++----- block/trace-events | 1 + 3 files changed, 117 insertions(+), 12 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h index a488d761ff..f51f478e34 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -65,6 +65,9 @@ #define QCOW2_MAX_BITMAPS 65535 #define QCOW2_MAX_BITMAP_DIRECTORY_SIZE (1024 * QCOW2_MAX_BITMAPS) =20 +/* Maximum of parallel sub-request per guest request */ +#define QCOW2_MAX_WORKERS 8 + /* indicate that the refcount of the referenced cluster is exactly one. */ #define QCOW_OFLAG_COPIED (1ULL << 63) /* indicate that the cluster is compressed (they never have the copied fla= g) */ diff --git a/block/qcow2.c b/block/qcow2.c index 164b22e4a2..7961c05783 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -41,6 +41,7 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/qapi-visit-block-core.h" #include "crypto.h" +#include "block/aio_task.h" =20 /* Differences with QCOW: @@ -2025,6 +2026,60 @@ fail: return ret; } =20 +typedef struct Qcow2AioTask { + AioTask task; + + BlockDriverState *bs; + QCow2ClusterType cluster_type; /* only for read */ + uint64_t file_cluster_offset; + uint64_t offset; + uint64_t bytes; + QEMUIOVector *qiov; + uint64_t qiov_offset; + QCowL2Meta *l2meta; /* only for write */ +} Qcow2AioTask; + +static coroutine_fn int qcow2_co_preadv_task_entry(AioTask *task); +static coroutine_fn int qcow2_add_task(BlockDriverState *bs, + AioTaskPool *pool, + AioTaskFunc func, + QCow2ClusterType cluster_type, + uint64_t file_cluster_offset, + uint64_t offset, + uint64_t bytes, + QEMUIOVector *qiov, + size_t qiov_offset, + QCowL2Meta *l2meta) +{ + Qcow2AioTask local_task; + Qcow2AioTask *task =3D pool ? g_new(Qcow2AioTask, 1) : &local_task; + + *task =3D (Qcow2AioTask) { + .task.func =3D func, + .bs =3D bs, + .cluster_type =3D cluster_type, + .qiov =3D qiov, + .file_cluster_offset =3D file_cluster_offset, + .offset =3D offset, + .bytes =3D bytes, + .qiov_offset =3D qiov_offset, + .l2meta =3D l2meta, + }; + + trace_qcow2_add_task(qemu_coroutine_self(), bs, pool, + func =3D=3D qcow2_co_preadv_task_entry ? "read" := "write", + cluster_type, file_cluster_offset, offset, bytes, + qiov, qiov_offset); + + if (!pool) { + return func(&task->task); + } + + aio_task_pool_start_task(pool, &task->task); + + return 0; +} + static coroutine_fn int qcow2_co_preadv_task(BlockDriverState *bs, QCow2ClusterType cluster_type, uint64_t file_cluster_offset, @@ -2074,18 +2129,28 @@ static coroutine_fn int qcow2_co_preadv_task(BlockD= riverState *bs, g_assert_not_reached(); } =20 +static coroutine_fn int qcow2_co_preadv_task_entry(AioTask *task) +{ + Qcow2AioTask *t =3D container_of(task, Qcow2AioTask, task); + + assert(!t->l2meta); + + return qcow2_co_preadv_task(t->bs, t->cluster_type, t->file_cluster_of= fset, + t->offset, t->bytes, t->qiov, t->qiov_offs= et); +} + static coroutine_fn int qcow2_co_preadv_part(BlockDriverState *bs, uint64_t offset, uint64_t byt= es, QEMUIOVector *qiov, size_t qiov_offset, int flags) { BDRVQcow2State *s =3D bs->opaque; - int ret; + int ret =3D 0; unsigned int cur_bytes; /* number of bytes in current iteration */ uint64_t cluster_offset =3D 0; + AioTaskPool *aio =3D NULL; =20 - while (bytes !=3D 0) { - + while (bytes !=3D 0 && aio_task_pool_status(aio) =3D=3D 0) { /* prepare next request */ cur_bytes =3D MIN(bytes, INT_MAX); if (s->crypto) { @@ -2097,7 +2162,7 @@ static coroutine_fn int qcow2_co_preadv_part(BlockDri= verState *bs, ret =3D qcow2_get_cluster_offset(bs, offset, &cur_bytes, &cluster_= offset); qemu_co_mutex_unlock(&s->lock); if (ret < 0) { - return ret; + goto out; } =20 if (ret =3D=3D QCOW2_CLUSTER_ZERO_PLAIN || @@ -2106,11 +2171,14 @@ static coroutine_fn int qcow2_co_preadv_part(BlockD= riverState *bs, { qemu_iovec_memset(qiov, qiov_offset, 0, cur_bytes); } else { - ret =3D qcow2_co_preadv_task(bs, ret, - cluster_offset, offset, cur_bytes, - qiov, qiov_offset); + if (!aio && cur_bytes !=3D bytes) { + aio =3D aio_task_pool_new(QCOW2_MAX_WORKERS); + } + ret =3D qcow2_add_task(bs, aio, qcow2_co_preadv_task_entry, re= t, + cluster_offset, offset, cur_bytes, + qiov, qiov_offset, NULL); if (ret < 0) { - return ret; + goto out; } } =20 @@ -2119,7 +2187,16 @@ static coroutine_fn int qcow2_co_preadv_part(BlockDr= iverState *bs, qiov_offset +=3D cur_bytes; } =20 - return 0; +out: + if (aio) { + aio_task_pool_wait_all(aio); + if (ret =3D=3D 0) { + ret =3D aio_task_pool_status(aio); + } + g_free(aio); + } + + return ret; } =20 /* Check if it's possible to merge a write request with the writing of @@ -2324,6 +2401,17 @@ out_locked: return ret; } =20 +static coroutine_fn int qcow2_co_pwritev_task_entry(AioTask *task) +{ + Qcow2AioTask *t =3D container_of(task, Qcow2AioTask, task); + + assert(!t->cluster_type); + + return qcow2_co_pwritev_task(t->bs, t->file_cluster_offset, + t->offset, t->bytes, t->qiov, t->qiov_off= set, + t->l2meta); +} + static coroutine_fn int qcow2_co_pwritev_part( BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, size_t qiov_offset, int flags) @@ -2334,10 +2422,11 @@ static coroutine_fn int qcow2_co_pwritev_part( unsigned int cur_bytes; /* number of sectors in current iteration */ uint64_t cluster_offset; QCowL2Meta *l2meta =3D NULL; + AioTaskPool *aio =3D NULL; =20 trace_qcow2_writev_start_req(qemu_coroutine_self(), offset, bytes); =20 - while (bytes !=3D 0) { + while (bytes !=3D 0 && aio_task_pool_status(aio) =3D=3D 0) { =20 l2meta =3D NULL; =20 @@ -2369,8 +2458,12 @@ static coroutine_fn int qcow2_co_pwritev_part( =20 qemu_co_mutex_unlock(&s->lock); =20 - ret =3D qcow2_co_pwritev_task(bs, cluster_offset, offset, cur_byte= s, - qiov, qiov_offset, l2meta); + if (!aio && cur_bytes !=3D bytes) { + aio =3D aio_task_pool_new(QCOW2_MAX_WORKERS); + } + ret =3D qcow2_add_task(bs, aio, qcow2_co_pwritev_task_entry, 0, + cluster_offset, offset, cur_bytes, + qiov, qiov_offset, l2meta); l2meta =3D NULL; /* l2meta is consumed by qcow2_co_pwritev_task() = */ if (ret < 0) { goto fail_nometa; @@ -2391,6 +2484,14 @@ out_locked: qemu_co_mutex_unlock(&s->lock); =20 fail_nometa: + if (aio) { + aio_task_pool_wait_all(aio); + if (ret =3D=3D 0) { + ret =3D aio_task_pool_status(aio); + } + g_free(aio); + } + trace_qcow2_writev_done_req(qemu_coroutine_self(), ret); =20 return ret; diff --git a/block/trace-events b/block/trace-events index 04209f058d..3aa27e6b1e 100644 --- a/block/trace-events +++ b/block/trace-events @@ -62,6 +62,7 @@ file_paio_submit(void *acb, void *opaque, int64_t offset,= int count, int type) " file_copy_file_range(void *bs, int src, int64_t src_off, int dst, int64_t = dst_off, int64_t bytes, int flags, int64_t ret) "bs %p src_fd %d offset %"P= RIu64" dst_fd %d offset %"PRIu64" bytes %"PRIu64" flags %d ret %"PRId64 =20 # qcow2.c +qcow2_add_task(void *co, void *bs, void *pool, const char *action, int clu= ster_type, uint64_t file_cluster_offset, uint64_t offset, uint64_t bytes, v= oid *qiov, size_t qiov_offset) "co %p bs %p pool %p: %s: cluster_type %d fi= le_cluster_offset %" PRIu64 " offset %" PRIu64 " bytes %" PRIu64 " qiov %p = qiov_offset %zu" qcow2_writev_start_req(void *co, int64_t offset, int bytes) "co %p offset = 0x%" PRIx64 " bytes %d" qcow2_writev_done_req(void *co, int ret) "co %p ret %d" qcow2_writev_start_part(void *co) "co %p" --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570708620; cv=none; d=zoho.com; s=zohoarc; b=H7pVzZlqbr+LxUhv/MjyzSa/zU7rgJRnk0AiqRk5JM4yqrgc+0e+tz5vqy5SpvonsYfnMqK7WGaJg96zrqbI86ovZD8dNSDgr6uqtDUGc8k8jKK9ym4qHMGCVN3kN8MVHahew0c0kHhYzHxYQ9i2GXMUiF0W+IDRQ6PaUfkOyPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570708620; 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; bh=TikPFlOGby/dysBtZx+0p/PbFUoDL6VQlIYYd+0EnYI=; b=JZJQ4M8vDmAB4A7ZaswtTw+pCNEqaADvDuTO5JrpU0EQK7DCJsFoy30No/nYPd+YapT3EMVcEYVeFpBHBa47HvNyZ9tNfq4VXFhMQGQqpb92n2kJb7Dv4ED0GBM9RWVU4iuPF5MRKAgB9aUOlgQx75h0wzN957rRaRBIyoHJkIQ= 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 15707086209374.149973551286621; Thu, 10 Oct 2019 04:57:00 -0700 (PDT) Received: from localhost ([::1]:36808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIX3o-0004tM-A6 for importer@patchew.org; Thu, 10 Oct 2019 07:56:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51672) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWqm-0006Mc-H2 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWql-00086b-H6 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54960) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqi-00085T-T8; Thu, 10 Oct 2019 07:43:17 -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 22EF689810E; Thu, 10 Oct 2019 11:43:16 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAFE45C241; Thu, 10 Oct 2019 11:43:15 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 06/36] block/backup: fix max_transfer handling for copy_range Date: Thu, 10 Oct 2019 13:42:30 +0200 Message-Id: <20191010114300.7746-7-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.6.2 (mx1.redhat.com [10.5.110.67]); Thu, 10 Oct 2019 11:43:16 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Of course, QEMU_ALIGN_UP is a typo, it should be QEMU_ALIGN_DOWN, as we are trying to find aligned size which satisfy both source and target. Also, don't ignore too small max_transfer. In this case seems safer to disable copy_range. Fixes: 9ded4a0114968e Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20190920142056.12778-2-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/backup.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/block/backup.c b/block/backup.c index 763f0d7ff6..db20249063 100644 --- a/block/backup.c +++ b/block/backup.c @@ -741,12 +741,19 @@ BlockJob *backup_job_create(const char *job_id, Block= DriverState *bs, job->cluster_size =3D cluster_size; job->copy_bitmap =3D copy_bitmap; copy_bitmap =3D NULL; - 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, - QEMU_ALIGN_UP(job->copy_range_size, - job->cluster_size)); + job->copy_range_size =3D QEMU_ALIGN_DOWN(job->copy_range_size, + job->cluster_size); + /* + * Set use_copy_range, consider the following: + * 1. Compression is not supported for copy_range. + * 2. copy_range does not respect max_transfer (it's a TODO), so we fa= ctor + * that in here. If max_transfer is smaller than the job->cluster_s= ize, + * we do not use copy_range (in that case it's zero after aligning = down + * above). + */ + job->use_copy_range =3D !compress && job->copy_range_size > 0; =20 /* Required permissions are already taken with target's blk_new() */ block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL, --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709473; cv=none; d=zoho.com; s=zohoarc; b=JdOR7PP6Gn5Z+DOXA/bM/grBmKXFrXtL8X1CMkjKKRaYTLnotN1q0HOmBldFU7/A0DSakwUHCj+IQVnGtYI7Pf+HeCp9J/267YLb/9gjTaF+9WXO2AlQd9PwJ9EpyWmb3Jzar9MqEpBhNAz0EFxCEijtYaS+kPgsvL4jwf3+qhM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709473; 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; bh=YMuYyCetb8H8jr11OzJdh+4KLicdRmRqIre5FjpkDu4=; b=Z67i7ZEpy9ALtc7TerdyxU4T+A+h4BrJ+Sh+ym4dCNFj3Qe0lO0MeADP7vLenkhoZsc5mzf2/rog5SAM67g6L4Pyei8zlQH45ZzBukdIzihfcG8EgIfAdCaNW/Z2rLk4kC2V7cNRkjSLXBpWrT+Fu+lkd+d0BITr8mD44sInQ6s= 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 1570709473498631.7527519371687; Thu, 10 Oct 2019 05:11:13 -0700 (PDT) Received: from localhost ([::1]:36966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXHj-0003iF-V2 for importer@patchew.org; Thu, 10 Oct 2019 08:11:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51697) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWqo-0006Pj-CW for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWqn-00087A-9X for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34034) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWql-00086E-2c; Thu, 10 Oct 2019 07:43:19 -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 54CB918C8900; Thu, 10 Oct 2019 11:43:18 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E904019C4F; Thu, 10 Oct 2019 11:43:17 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 07/36] block/backup: fix backup_cow_with_offload for last cluster Date: Thu, 10 Oct 2019 13:42:31 +0200 Message-Id: <20191010114300.7746-8-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.6.2 (mx1.redhat.com [10.5.110.70]); Thu, 10 Oct 2019 11:43:18 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 We shouldn't try to copy bytes beyond EOF. Fix it. Fixes: 9ded4a0114968e Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow Message-id: 20190920142056.12778-3-vsementsov@virtuozzo.com 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 db20249063..99177f03f8 100644 --- a/block/backup.c +++ b/block/backup.c @@ -161,7 +161,7 @@ static int coroutine_fn backup_cow_with_offload(BackupB= lockJob *job, =20 assert(QEMU_IS_ALIGNED(job->copy_range_size, job->cluster_size)); assert(QEMU_IS_ALIGNED(start, job->cluster_size)); - nbytes =3D MIN(job->copy_range_size, end - start); + nbytes =3D MIN(job->copy_range_size, MIN(end, job->len) - start); nr_clusters =3D DIV_ROUND_UP(nbytes, job->cluster_size); bdrv_reset_dirty_bitmap(job->copy_bitmap, start, job->cluster_size * nr_clusters); --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570708815; cv=none; d=zoho.com; s=zohoarc; b=IppDMc/DGvzHkP9POJASbgwEZnMv9828nBUPPLi4gIcJrxPmRGw8h+w65KC77z4dCB/z8OcMLN3kb2P0g1yX/9ItFnQA5Ej6yi+E+hVayrHgcBYBgd/g4iXEc+dFCvS5Vda3uQauSoQw/qIs+Z2mifFbAIzns5VtTvT5u+wqvgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570708815; 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; bh=+Vi4irTSmTP2187qeTkwyqrpK2c8gGcPfXPX/LhFyVg=; b=mmsAQWbmp/HTaFCu6zOraIc5x2SnUEaD+wtcVuvJ4JpDh8YsV7EyzFLq6ulz1IzPL4ykEsDSo5pVJFU7q5S6aXY3m9jAhiszF4HP/9HbxzMyyifAFJkqaK3nifV1883/jiXcJ4PhbHRf9/z1LhTpouspf+6FNgwMJoHi+/AhTr4= 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 1570708815094175.64353768870444; Thu, 10 Oct 2019 05:00:15 -0700 (PDT) Received: from localhost ([::1]:36840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIX77-00006F-8r for importer@patchew.org; Thu, 10 Oct 2019 08:00:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51727) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWqr-0006Ss-NA for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWqq-000881-GV for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34052) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqn-00086z-3c; Thu, 10 Oct 2019 07:43:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5DD6C18C8902; Thu, 10 Oct 2019 11:43:20 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 053E760A9F; Thu, 10 Oct 2019 11:43:19 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 08/36] block/backup: split shareable copying part from backup_do_cow Date: Thu, 10 Oct 2019 13:42:32 +0200 Message-Id: <20191010114300.7746-9-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Thu, 10 Oct 2019 11:43:20 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Split copying logic which will be shared with backup-top filter. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190920142056.12778-4-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/backup.c | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/block/backup.c b/block/backup.c index 99177f03f8..98d7f7a905 100644 --- a/block/backup.c +++ b/block/backup.c @@ -248,26 +248,18 @@ static int64_t backup_bitmap_reset_unallocated(Backup= BlockJob *s, return ret; } =20 -static int coroutine_fn backup_do_cow(BackupBlockJob *job, - int64_t offset, uint64_t bytes, - bool *error_is_read, - bool is_write_notifier) +static int coroutine_fn backup_do_copy(BackupBlockJob *job, + int64_t start, uint64_t bytes, + bool *error_is_read, + bool is_write_notifier) { - CowRequest cow_request; int ret =3D 0; - int64_t start, end; /* bytes */ + int64_t end =3D bytes + start; /* bytes */ void *bounce_buffer =3D NULL; int64_t status_bytes; =20 - qemu_co_rwlock_rdlock(&job->flush_rwlock); - - start =3D QEMU_ALIGN_DOWN(offset, job->cluster_size); - end =3D QEMU_ALIGN_UP(bytes + offset, job->cluster_size); - - trace_backup_do_cow_enter(job, start, offset, bytes); - - wait_for_overlapping_requests(job, start, end); - cow_request_begin(&cow_request, job, start, end); + assert(QEMU_IS_ALIGNED(start, job->cluster_size)); + assert(QEMU_IS_ALIGNED(end, job->cluster_size)); =20 while (start < end) { int64_t dirty_end; @@ -326,6 +318,31 @@ static int coroutine_fn backup_do_cow(BackupBlockJob *= job, qemu_vfree(bounce_buffer); } =20 + return ret; +} + +static int coroutine_fn backup_do_cow(BackupBlockJob *job, + int64_t offset, uint64_t bytes, + bool *error_is_read, + bool is_write_notifier) +{ + CowRequest cow_request; + int ret =3D 0; + int64_t start, end; /* bytes */ + + qemu_co_rwlock_rdlock(&job->flush_rwlock); + + start =3D QEMU_ALIGN_DOWN(offset, job->cluster_size); + end =3D QEMU_ALIGN_UP(bytes + offset, job->cluster_size); + + trace_backup_do_cow_enter(job, start, offset, bytes); + + wait_for_overlapping_requests(job, start, end); + cow_request_begin(&cow_request, job, start, end); + + ret =3D backup_do_copy(job, start, end - start, error_is_read, + is_write_notifier); + cow_request_end(&cow_request); =20 trace_backup_do_cow_return(job, offset, bytes, ret); --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709877; cv=none; d=zoho.com; s=zohoarc; b=IVaLoC8VII0gwY1SUyzGf0kx3LTawC2a2K1kAKHx1VF9Zl7GdyHC3mZQ9jPJJsplP6QmFBQC14FLvixyepfZ5u5KTkipAmkvXBjUcfk8IA4jT/iwI3Kq/ZShVBYXhQHHGa+L3qe3ZPwUbcwWy9/scMcZjkMiK0ZCR8Qe3u6u954= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709877; 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; bh=9f+k6ksmcCALB4j7iaCyKyy1/Gdo9wseAhgk4e7fW/o=; b=O1GBJja38jLRVJNdNbyN+beBSuz74M5jj9qsd/Ze+/EHrIeOD2FeP7jgr+EMBCrFo6q/mJOy2TC+vyoOshSyb+5Cczd0fVLJRUbnKXC559FdLX4ZEkTfHpJcfycfhhT1+qiPG9SarkJYrFyvrxHicCNglQnfl5TWANhF6Y3Xf90= 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 1570709877029729.8078518009004; Thu, 10 Oct 2019 05:17:57 -0700 (PDT) Received: from localhost ([::1]:37028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXOD-0001sM-DW for importer@patchew.org; Thu, 10 Oct 2019 08:17:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51737) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWqs-0006UQ-I7 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWqr-00089g-G5 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60456) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqp-00087f-5k; Thu, 10 Oct 2019 07:43:23 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C2793066FA7; Thu, 10 Oct 2019 11:43:22 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1325D600C4; Thu, 10 Oct 2019 11:43:21 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 09/36] block/backup: improve comment about image fleecing Date: Thu, 10 Oct 2019 13:42:33 +0200 Message-Id: <20191010114300.7746-10-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 10 Oct 2019 11:43:22 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190920142056.12778-5-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/backup.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/block/backup.c b/block/backup.c index 98d7f7a905..ae28849660 100644 --- a/block/backup.c +++ b/block/backup.c @@ -747,9 +747,18 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, job->bitmap_mode =3D bitmap_mode; =20 /* - * Set write flags: - * 1. Detect image-fleecing (and similar) schemes - * 2. Handle compression + * If source is in backing chain of target assume that target is going= to be + * used for "image fleecing", i.e. it should represent a kind of snaps= hot of + * source at backup-start point in time. And target is going to be rea= d by + * somebody (for example, used as NBD export) during backup job. + * + * In this case, we need to add BDRV_REQ_SERIALISING write flag to avo= id + * intersection of backup writes and third party reads from target, + * otherwise reading from target we may occasionally read already upda= ted by + * guest data. + * + * For more information see commit f8d59dfb40bb and test + * tests/qemu-iotests/222 */ job->write_flags =3D (bdrv_chain_contains(target, bs) ? BDRV_REQ_SERIALISING : 0) | --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709262; cv=none; d=zoho.com; s=zohoarc; b=E0XuM2R3+DZNGcUbyM2BlEELKJtQphpv0znBh2jlRuAAoo61x6WdID94kn8kzXqHQgPMoIcY2xw5CQXWbxbGwocUEd2VT7Yg/PeC6mqlypst4bDI8cWYZ7kuYPMI5pEUR+OflCLx3S38ixGB3kXoDBvuECoIdtEZ3A0jeQupmoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709262; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6KeUUQYCZTCFqX34ONn1dLBoA5liIBqvMaWble9L/Ks=; b=elQmKGV9+Wnd9fmjwn/Jdy4GkWNd+rseKSGWNG2ZF5RbwGLhLSZ/ywu2UyKLeKShoQloFF9R/5Xw0qeaxJBM3aAALtE3ty6Hf7BxaM7ObInkPHdRqm5kMEacCAl6KBqckoZjzqsY3DBeB80w2wL1lHaERjT+y4Gd7fKxV33Lp+w= 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 1570709262023136.58042072242665; Thu, 10 Oct 2019 05:07:42 -0700 (PDT) Received: from localhost ([::1]:36910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXEK-0007O4-KV for importer@patchew.org; Thu, 10 Oct 2019 08:07:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51811) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWr2-0006b1-3t for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWqy-0008BW-HJ for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38744) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqr-00088r-K9; Thu, 10 Oct 2019 07:43:25 -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 D4B3966974; Thu, 10 Oct 2019 11:43:24 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F12F60BE1; Thu, 10 Oct 2019 11:43:23 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 10/36] block/backup: introduce BlockCopyState Date: Thu, 10 Oct 2019 13:42:34 +0200 Message-Id: <20191010114300.7746-11-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.38]); Thu, 10 Oct 2019 11:43:24 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Split copying code part from backup to "block-copy", including separate state structure and function renaming. This is needed to share it with backup-top filter driver in further commits. Notes: 1. As BlockCopyState keeps own BlockBackend objects, remaining job->common.blk users only use it to get bs by blk_bs() call, so clear job->commen.blk permissions set in block_job_create and add job->source_bs to be used instead of blk_bs(job->common.blk), to keep it more clear which bs we use when introduce backup-top filter in further commit. 2. Rename s/initializing_bitmap/skip_unallocated/ to sound a bit better as interface to BlockCopyState 3. Split is not very clean: there left some duplicated fields, backup code uses some BlockCopyState fields directly, let's postpone it for further improvements and keep this comment simpler for review. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20190920142056.12778-6-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/backup.c | 370 ++++++++++++++++++++++++++++----------------- block/trace-events | 12 +- 2 files changed, 239 insertions(+), 143 deletions(-) diff --git a/block/backup.c b/block/backup.c index ae28849660..5dda1673ca 100644 --- a/block/backup.c +++ b/block/backup.c @@ -35,12 +35,52 @@ typedef struct CowRequest { CoQueue wait_queue; /* coroutines blocked on this request */ } CowRequest; =20 +typedef void (*ProgressBytesCallbackFunc)(int64_t bytes, void *opaque); +typedef void (*ProgressResetCallbackFunc)(void *opaque); +typedef struct BlockCopyState { + BlockBackend *source; + BlockBackend *target; + BdrvDirtyBitmap *copy_bitmap; + int64_t cluster_size; + bool use_copy_range; + int64_t copy_range_size; + uint64_t len; + + BdrvRequestFlags write_flags; + + /* + * skip_unallocated: + * + * Used by sync=3Dtop jobs, which first scan the source node for unall= ocated + * areas and clear them in the copy_bitmap. During this process, the = bitmap + * is thus not fully initialized: It may still have bits set for areas= that + * are unallocated and should actually not be copied. + * + * This is indicated by skip_unallocated. + * + * In this case, block_copy() will query the source=E2=80=99s allocati= on status, + * skip unallocated regions, clear them in the copy_bitmap, and invoke + * block_copy_reset_unallocated() every time it does. + */ + bool skip_unallocated; + + /* progress_bytes_callback: called when some copying progress is done.= */ + ProgressBytesCallbackFunc progress_bytes_callback; + + /* + * progress_reset_callback: called when some bytes reset from copy_bit= map + * (see @skip_unallocated above). The callee is assumed to recalculate= how + * many bytes remain based on the dirty bit count of copy_bitmap. + */ + ProgressResetCallbackFunc progress_reset_callback; + void *progress_opaque; +} BlockCopyState; + typedef struct BackupBlockJob { BlockJob common; - BlockBackend *target; + BlockDriverState *source_bs; =20 BdrvDirtyBitmap *sync_bitmap; - BdrvDirtyBitmap *copy_bitmap; =20 MirrorSyncMode sync_mode; BitmapSyncMode bitmap_mode; @@ -53,11 +93,7 @@ typedef struct BackupBlockJob { NotifierWithReturn before_write; QLIST_HEAD(, CowRequest) inflight_reqs; =20 - bool use_copy_range; - int64_t copy_range_size; - - BdrvRequestFlags write_flags; - bool initializing_bitmap; + BlockCopyState *bcs; } BackupBlockJob; =20 static const BlockJobDriver backup_job_driver; @@ -99,9 +135,97 @@ static void cow_request_end(CowRequest *req) qemu_co_queue_restart_all(&req->wait_queue); } =20 +static void block_copy_state_free(BlockCopyState *s) +{ + if (!s) { + return; + } + + bdrv_release_dirty_bitmap(blk_bs(s->source), s->copy_bitmap); + blk_unref(s->source); + blk_unref(s->target); + g_free(s); +} + +static BlockCopyState *block_copy_state_new( + BlockDriverState *source, BlockDriverState *target, + int64_t cluster_size, BdrvRequestFlags write_flags, + ProgressBytesCallbackFunc progress_bytes_callback, + ProgressResetCallbackFunc progress_reset_callback, + void *progress_opaque, Error **errp) +{ + BlockCopyState *s; + int ret; + uint64_t no_resize =3D BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE | + BLK_PERM_WRITE_UNCHANGED | BLK_PERM_GRAPH_MOD; + BdrvDirtyBitmap *copy_bitmap; + + copy_bitmap =3D bdrv_create_dirty_bitmap(source, cluster_size, NULL, e= rrp); + if (!copy_bitmap) { + return NULL; + } + bdrv_disable_dirty_bitmap(copy_bitmap); + + s =3D g_new(BlockCopyState, 1); + *s =3D (BlockCopyState) { + .source =3D blk_new(bdrv_get_aio_context(source), + BLK_PERM_CONSISTENT_READ, no_resize), + .target =3D blk_new(bdrv_get_aio_context(target), + BLK_PERM_WRITE, no_resize), + .copy_bitmap =3D copy_bitmap, + .cluster_size =3D cluster_size, + .len =3D bdrv_dirty_bitmap_size(copy_bitmap), + .write_flags =3D write_flags, + .progress_bytes_callback =3D progress_bytes_callback, + .progress_reset_callback =3D progress_reset_callback, + .progress_opaque =3D progress_opaque, + }; + + s->copy_range_size =3D QEMU_ALIGN_DOWN(MIN(blk_get_max_transfer(s->sou= rce), + blk_get_max_transfer(s->targe= t)), + s->cluster_size); + /* + * Set use_copy_range, consider the following: + * 1. Compression is not supported for copy_range. + * 2. copy_range does not respect max_transfer (it's a TODO), so we fa= ctor + * that in here. If max_transfer is smaller than the job->cluster_s= ize, + * we do not use copy_range (in that case it's zero after aligning = down + * above). + */ + s->use_copy_range =3D + !(write_flags & BDRV_REQ_WRITE_COMPRESSED) && s->copy_range_size >= 0; + + /* + * We just allow aio context change on our block backends. block_copy(= ) user + * (now it's only backup) is responsible for source and target being i= n same + * aio context. + */ + blk_set_disable_request_queuing(s->source, true); + blk_set_allow_aio_context_change(s->source, true); + blk_set_disable_request_queuing(s->target, true); + blk_set_allow_aio_context_change(s->target, true); + + ret =3D blk_insert_bs(s->source, source, errp); + if (ret < 0) { + goto fail; + } + + ret =3D blk_insert_bs(s->target, target, errp); + if (ret < 0) { + goto fail; + } + + return s; + +fail: + block_copy_state_free(s); + + return NULL; +} + /* Copy range to target with a bounce buffer and return the bytes copied. = If * error occurred, return a negative error number */ -static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job, +static int coroutine_fn block_copy_with_bounce_buffer(BlockCopyState *s, int64_t start, int64_t end, bool is_write_notifi= er, @@ -109,30 +233,29 @@ static int coroutine_fn backup_cow_with_bounce_buffer= (BackupBlockJob *job, void **bounce_buffer) { int ret; - BlockBackend *blk =3D job->common.blk; int nbytes; int read_flags =3D is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0; =20 - assert(QEMU_IS_ALIGNED(start, job->cluster_size)); - bdrv_reset_dirty_bitmap(job->copy_bitmap, start, job->cluster_size); - nbytes =3D MIN(job->cluster_size, job->len - start); + assert(QEMU_IS_ALIGNED(start, s->cluster_size)); + bdrv_reset_dirty_bitmap(s->copy_bitmap, start, s->cluster_size); + nbytes =3D MIN(s->cluster_size, s->len - start); if (!*bounce_buffer) { - *bounce_buffer =3D blk_blockalign(blk, job->cluster_size); + *bounce_buffer =3D blk_blockalign(s->source, s->cluster_size); } =20 - ret =3D blk_co_pread(blk, start, nbytes, *bounce_buffer, read_flags); + ret =3D blk_co_pread(s->source, start, nbytes, *bounce_buffer, read_fl= ags); if (ret < 0) { - trace_backup_do_cow_read_fail(job, start, ret); + trace_block_copy_with_bounce_buffer_read_fail(s, start, ret); if (error_is_read) { *error_is_read =3D true; } goto fail; } =20 - ret =3D blk_co_pwrite(job->target, start, nbytes, *bounce_buffer, - job->write_flags); + ret =3D blk_co_pwrite(s->target, start, nbytes, *bounce_buffer, + s->write_flags); if (ret < 0) { - trace_backup_do_cow_write_fail(job, start, ret); + trace_block_copy_with_bounce_buffer_write_fail(s, start, ret); if (error_is_read) { *error_is_read =3D false; } @@ -141,36 +264,35 @@ static int coroutine_fn backup_cow_with_bounce_buffer= (BackupBlockJob *job, =20 return nbytes; fail: - bdrv_set_dirty_bitmap(job->copy_bitmap, start, job->cluster_size); + bdrv_set_dirty_bitmap(s->copy_bitmap, start, s->cluster_size); return ret; =20 } =20 /* Copy range to target and return the bytes copied. If error occurred, re= turn a * negative error number. */ -static int coroutine_fn backup_cow_with_offload(BackupBlockJob *job, +static int coroutine_fn block_copy_with_offload(BlockCopyState *s, int64_t start, int64_t end, bool is_write_notifier) { int ret; int nr_clusters; - BlockBackend *blk =3D job->common.blk; int nbytes; int read_flags =3D is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0; =20 - assert(QEMU_IS_ALIGNED(job->copy_range_size, job->cluster_size)); - assert(QEMU_IS_ALIGNED(start, job->cluster_size)); - nbytes =3D MIN(job->copy_range_size, MIN(end, job->len) - start); - nr_clusters =3D DIV_ROUND_UP(nbytes, job->cluster_size); - bdrv_reset_dirty_bitmap(job->copy_bitmap, start, - job->cluster_size * nr_clusters); - ret =3D blk_co_copy_range(blk, start, job->target, start, nbytes, - read_flags, job->write_flags); + assert(QEMU_IS_ALIGNED(s->copy_range_size, s->cluster_size)); + assert(QEMU_IS_ALIGNED(start, s->cluster_size)); + nbytes =3D MIN(s->copy_range_size, MIN(end, s->len) - start); + nr_clusters =3D DIV_ROUND_UP(nbytes, s->cluster_size); + bdrv_reset_dirty_bitmap(s->copy_bitmap, start, + s->cluster_size * nr_clusters); + ret =3D blk_co_copy_range(s->source, start, s->target, start, nbytes, + read_flags, s->write_flags); if (ret < 0) { - trace_backup_do_cow_copy_range_fail(job, start, ret); - bdrv_set_dirty_bitmap(job->copy_bitmap, start, - job->cluster_size * nr_clusters); + trace_block_copy_with_offload_fail(s, start, ret); + bdrv_set_dirty_bitmap(s->copy_bitmap, start, + s->cluster_size * nr_clusters); return ret; } =20 @@ -181,10 +303,10 @@ static int coroutine_fn backup_cow_with_offload(Backu= pBlockJob *job, * Check if the cluster starting at offset is allocated or not. * return via pnum the number of contiguous clusters sharing this allocati= on. */ -static int backup_is_cluster_allocated(BackupBlockJob *s, int64_t offset, - int64_t *pnum) +static int block_copy_is_cluster_allocated(BlockCopyState *s, int64_t offs= et, + int64_t *pnum) { - BlockDriverState *bs =3D blk_bs(s->common.blk); + BlockDriverState *bs =3D blk_bs(s->source); int64_t count, total_count =3D 0; int64_t bytes =3D s->len - offset; int ret; @@ -225,13 +347,13 @@ static int backup_is_cluster_allocated(BackupBlockJob= *s, int64_t offset, * @return 0 when the cluster at @offset was unallocated, * 1 otherwise, and -ret on error. */ -static int64_t backup_bitmap_reset_unallocated(BackupBlockJob *s, - int64_t offset, int64_t *co= unt) +static int64_t block_copy_reset_unallocated(BlockCopyState *s, + int64_t offset, int64_t *count) { int ret; - int64_t clusters, bytes, estimate; + int64_t clusters, bytes; =20 - ret =3D backup_is_cluster_allocated(s, offset, &clusters); + ret =3D block_copy_is_cluster_allocated(s, offset, &clusters); if (ret < 0) { return ret; } @@ -240,46 +362,51 @@ static int64_t backup_bitmap_reset_unallocated(Backup= BlockJob *s, =20 if (!ret) { bdrv_reset_dirty_bitmap(s->copy_bitmap, offset, bytes); - estimate =3D bdrv_get_dirty_count(s->copy_bitmap); - job_progress_set_remaining(&s->common.job, estimate); + s->progress_reset_callback(s->progress_opaque); } =20 *count =3D bytes; return ret; } =20 -static int coroutine_fn backup_do_copy(BackupBlockJob *job, - int64_t start, uint64_t bytes, - bool *error_is_read, - bool is_write_notifier) +static int coroutine_fn block_copy(BlockCopyState *s, + int64_t start, uint64_t bytes, + bool *error_is_read, + bool is_write_notifier) { int ret =3D 0; int64_t end =3D bytes + start; /* bytes */ void *bounce_buffer =3D NULL; int64_t status_bytes; =20 - assert(QEMU_IS_ALIGNED(start, job->cluster_size)); - assert(QEMU_IS_ALIGNED(end, job->cluster_size)); + /* + * block_copy() user is responsible for keeping source and target in s= ame + * aio context + */ + assert(blk_get_aio_context(s->source) =3D=3D blk_get_aio_context(s->ta= rget)); + + assert(QEMU_IS_ALIGNED(start, s->cluster_size)); + assert(QEMU_IS_ALIGNED(end, s->cluster_size)); =20 while (start < end) { int64_t dirty_end; =20 - if (!bdrv_dirty_bitmap_get(job->copy_bitmap, start)) { - trace_backup_do_cow_skip(job, start); - start +=3D job->cluster_size; + if (!bdrv_dirty_bitmap_get(s->copy_bitmap, start)) { + trace_block_copy_skip(s, start); + start +=3D s->cluster_size; continue; /* already copied */ } =20 - dirty_end =3D bdrv_dirty_bitmap_next_zero(job->copy_bitmap, start, + dirty_end =3D bdrv_dirty_bitmap_next_zero(s->copy_bitmap, start, (end - start)); if (dirty_end < 0) { dirty_end =3D end; } =20 - if (job->initializing_bitmap) { - ret =3D backup_bitmap_reset_unallocated(job, start, &status_by= tes); + if (s->skip_unallocated) { + ret =3D block_copy_reset_unallocated(s, start, &status_bytes); if (ret =3D=3D 0) { - trace_backup_do_cow_skip_range(job, start, status_bytes); + trace_block_copy_skip_range(s, start, status_bytes); start +=3D status_bytes; continue; } @@ -287,17 +414,17 @@ static int coroutine_fn backup_do_copy(BackupBlockJob= *job, dirty_end =3D MIN(dirty_end, start + status_bytes); } =20 - trace_backup_do_cow_process(job, start); + trace_block_copy_process(s, start); =20 - if (job->use_copy_range) { - ret =3D backup_cow_with_offload(job, start, dirty_end, + if (s->use_copy_range) { + ret =3D block_copy_with_offload(s, start, dirty_end, is_write_notifier); if (ret < 0) { - job->use_copy_range =3D false; + s->use_copy_range =3D false; } } - if (!job->use_copy_range) { - ret =3D backup_cow_with_bounce_buffer(job, start, dirty_end, + if (!s->use_copy_range) { + ret =3D block_copy_with_bounce_buffer(s, start, dirty_end, is_write_notifier, error_is_read, &bounce_buf= fer); } @@ -305,12 +432,8 @@ static int coroutine_fn backup_do_copy(BackupBlockJob = *job, break; } =20 - /* Publish progress, guest I/O counts as progress too. Note that = the - * offset field is an opaque progress value, it is not a disk offs= et. - */ start +=3D ret; - job->bytes_read +=3D ret; - job_progress_update(&job->common.job, ret); + s->progress_bytes_callback(ret, s->progress_opaque); ret =3D 0; } =20 @@ -321,6 +444,22 @@ static int coroutine_fn backup_do_copy(BackupBlockJob = *job, return ret; } =20 +static void backup_progress_bytes_callback(int64_t bytes, void *opaque) +{ + BackupBlockJob *s =3D opaque; + + s->bytes_read +=3D bytes; + job_progress_update(&s->common.job, bytes); +} + +static void backup_progress_reset_callback(void *opaque) +{ + BackupBlockJob *s =3D opaque; + uint64_t estimate =3D bdrv_get_dirty_count(s->bcs->copy_bitmap); + + job_progress_set_remaining(&s->common.job, estimate); +} + static int coroutine_fn backup_do_cow(BackupBlockJob *job, int64_t offset, uint64_t bytes, bool *error_is_read, @@ -340,8 +479,8 @@ static int coroutine_fn backup_do_cow(BackupBlockJob *j= ob, wait_for_overlapping_requests(job, start, end); cow_request_begin(&cow_request, job, start, end); =20 - ret =3D backup_do_copy(job, start, end - start, error_is_read, - is_write_notifier); + ret =3D block_copy(job->bcs, start, end - start, error_is_read, + is_write_notifier); =20 cow_request_end(&cow_request); =20 @@ -359,7 +498,7 @@ static int coroutine_fn backup_before_write_notify( BackupBlockJob *job =3D container_of(notifier, BackupBlockJob, before_= write); BdrvTrackedRequest *req =3D opaque; =20 - assert(req->bs =3D=3D blk_bs(job->common.blk)); + assert(req->bs =3D=3D job->source_bs); assert(QEMU_IS_ALIGNED(req->offset, BDRV_SECTOR_SIZE)); assert(QEMU_IS_ALIGNED(req->bytes, BDRV_SECTOR_SIZE)); =20 @@ -369,7 +508,6 @@ static int coroutine_fn backup_before_write_notify( static void backup_cleanup_sync_bitmap(BackupBlockJob *job, int ret) { BdrvDirtyBitmap *bm; - BlockDriverState *bs =3D blk_bs(job->common.blk); bool sync =3D (((ret =3D=3D 0) || (job->bitmap_mode =3D=3D BITMAP_SYNC= _MODE_ALWAYS)) \ && (job->bitmap_mode !=3D BITMAP_SYNC_MODE_NEVER)); =20 @@ -378,20 +516,20 @@ static void backup_cleanup_sync_bitmap(BackupBlockJob= *job, int ret) * We succeeded, or we always intended to sync the bitmap. * Delete this bitmap and install the child. */ - bm =3D bdrv_dirty_bitmap_abdicate(bs, job->sync_bitmap, NULL); + bm =3D bdrv_dirty_bitmap_abdicate(job->source_bs, job->sync_bitmap= , NULL); } else { /* * We failed, or we never intended to sync the bitmap anyway. * Merge the successor back into the parent, keeping all data. */ - bm =3D bdrv_reclaim_dirty_bitmap(bs, job->sync_bitmap, NULL); + bm =3D bdrv_reclaim_dirty_bitmap(job->source_bs, job->sync_bitmap,= NULL); } =20 assert(bm); =20 if (ret < 0 && job->bitmap_mode =3D=3D BITMAP_SYNC_MODE_ALWAYS) { /* If we failed and synced, merge in the bits we didn't copy: */ - bdrv_dirty_bitmap_merge_internal(bm, job->copy_bitmap, + bdrv_dirty_bitmap_merge_internal(bm, job->bcs->copy_bitmap, NULL, true); } } @@ -415,16 +553,8 @@ static void backup_abort(Job *job) static void backup_clean(Job *job) { BackupBlockJob *s =3D container_of(job, BackupBlockJob, common.job); - BlockDriverState *bs =3D blk_bs(s->common.blk); =20 - if (s->copy_bitmap) { - bdrv_release_dirty_bitmap(bs, s->copy_bitmap); - s->copy_bitmap =3D NULL; - } - - assert(s->target); - blk_unref(s->target); - s->target =3D NULL; + block_copy_state_free(s->bcs); } =20 void backup_do_checkpoint(BlockJob *job, Error **errp) @@ -439,7 +569,7 @@ void backup_do_checkpoint(BlockJob *job, Error **errp) return; } =20 - bdrv_set_dirty_bitmap(backup_job->copy_bitmap, 0, backup_job->len); + bdrv_set_dirty_bitmap(backup_job->bcs->copy_bitmap, 0, backup_job->len= ); } =20 static BlockErrorAction backup_error_action(BackupBlockJob *job, @@ -482,7 +612,7 @@ static int coroutine_fn backup_loop(BackupBlockJob *job) BdrvDirtyBitmapIter *bdbi; int ret =3D 0; =20 - bdbi =3D bdrv_dirty_iter_new(job->copy_bitmap); + bdbi =3D bdrv_dirty_iter_new(job->bcs->copy_bitmap); while ((offset =3D bdrv_dirty_iter_next(bdbi)) !=3D -1) { do { if (yield_and_check(job)) { @@ -509,7 +639,7 @@ static void backup_init_copy_bitmap(BackupBlockJob *job) uint64_t estimate; =20 if (job->sync_mode =3D=3D MIRROR_SYNC_MODE_BITMAP) { - ret =3D bdrv_dirty_bitmap_merge_internal(job->copy_bitmap, + ret =3D bdrv_dirty_bitmap_merge_internal(job->bcs->copy_bitmap, job->sync_bitmap, NULL, true); assert(ret); @@ -519,19 +649,18 @@ static void backup_init_copy_bitmap(BackupBlockJob *j= ob) * We can't hog the coroutine to initialize this thoroughly. * Set a flag and resume work when we are able to yield safely. */ - job->initializing_bitmap =3D true; + job->bcs->skip_unallocated =3D true; } - bdrv_set_dirty_bitmap(job->copy_bitmap, 0, job->len); + bdrv_set_dirty_bitmap(job->bcs->copy_bitmap, 0, job->len); } =20 - estimate =3D bdrv_get_dirty_count(job->copy_bitmap); + estimate =3D bdrv_get_dirty_count(job->bcs->copy_bitmap); job_progress_set_remaining(&job->common.job, estimate); } =20 static int coroutine_fn backup_run(Job *job, Error **errp) { BackupBlockJob *s =3D container_of(job, BackupBlockJob, common.job); - BlockDriverState *bs =3D blk_bs(s->common.blk); int ret =3D 0; =20 QLIST_INIT(&s->inflight_reqs); @@ -540,7 +669,7 @@ static int coroutine_fn backup_run(Job *job, Error **er= rp) backup_init_copy_bitmap(s); =20 s->before_write.notify =3D backup_before_write_notify; - bdrv_add_before_write_notifier(bs, &s->before_write); + bdrv_add_before_write_notifier(s->source_bs, &s->before_write); =20 if (s->sync_mode =3D=3D MIRROR_SYNC_MODE_TOP) { int64_t offset =3D 0; @@ -552,14 +681,14 @@ static int coroutine_fn backup_run(Job *job, Error **= errp) goto out; } =20 - ret =3D backup_bitmap_reset_unallocated(s, offset, &count); + ret =3D block_copy_reset_unallocated(s->bcs, offset, &count); if (ret < 0) { goto out; } =20 offset +=3D count; } - s->initializing_bitmap =3D false; + s->bcs->skip_unallocated =3D false; } =20 if (s->sync_mode =3D=3D MIRROR_SYNC_MODE_NONE) { @@ -646,9 +775,8 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, { int64_t len; BackupBlockJob *job =3D NULL; - int ret; int64_t cluster_size; - BdrvDirtyBitmap *copy_bitmap =3D NULL; + BdrvRequestFlags write_flags; =20 assert(bs); assert(target); @@ -713,33 +841,14 @@ BlockJob *backup_job_create(const char *job_id, Block= DriverState *bs, goto error; } =20 - copy_bitmap =3D bdrv_create_dirty_bitmap(bs, cluster_size, NULL, errp); - if (!copy_bitmap) { - goto error; - } - bdrv_disable_dirty_bitmap(copy_bitmap); - /* job->len is fixed, so we can't allow resize */ - job =3D block_job_create(job_id, &backup_job_driver, txn, bs, - BLK_PERM_CONSISTENT_READ, - BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE | - BLK_PERM_WRITE_UNCHANGED | BLK_PERM_GRAPH_MOD, + job =3D block_job_create(job_id, &backup_job_driver, txn, bs, 0, BLK_P= ERM_ALL, speed, creation_flags, cb, opaque, errp); if (!job) { goto error; } =20 - /* The target must match the source in size, so no resize here either = */ - job->target =3D blk_new(job->common.job.aio_context, - BLK_PERM_WRITE, - BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE | - BLK_PERM_WRITE_UNCHANGED | BLK_PERM_GRAPH_MOD); - ret =3D blk_insert_bs(job->target, target, errp); - if (ret < 0) { - goto error; - } - blk_set_disable_request_queuing(job->target, true); - + job->source_bs =3D bs; job->on_source_error =3D on_source_error; job->on_target_error =3D on_target_error; job->sync_mode =3D sync_mode; @@ -760,28 +869,19 @@ BlockJob *backup_job_create(const char *job_id, Block= DriverState *bs, * For more information see commit f8d59dfb40bb and test * tests/qemu-iotests/222 */ - job->write_flags =3D - (bdrv_chain_contains(target, bs) ? BDRV_REQ_SERIALISING : 0) | - (compress ? BDRV_REQ_WRITE_COMPRESSED : 0); + write_flags =3D (bdrv_chain_contains(target, bs) ? BDRV_REQ_SERIALISIN= G : 0) | + (compress ? BDRV_REQ_WRITE_COMPRESSED : 0), + + job->bcs =3D block_copy_state_new(bs, target, cluster_size, write_flag= s, + backup_progress_bytes_callback, + backup_progress_reset_callback, job, e= rrp); + if (!job->bcs) { + goto error; + } =20 job->cluster_size =3D cluster_size; - job->copy_bitmap =3D copy_bitmap; - copy_bitmap =3D NULL; - 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 QEMU_ALIGN_DOWN(job->copy_range_size, - job->cluster_size); - /* - * Set use_copy_range, consider the following: - * 1. Compression is not supported for copy_range. - * 2. copy_range does not respect max_transfer (it's a TODO), so we fa= ctor - * that in here. If max_transfer is smaller than the job->cluster_s= ize, - * we do not use copy_range (in that case it's zero after aligning = down - * above). - */ - job->use_copy_range =3D !compress && job->copy_range_size > 0; =20 - /* Required permissions are already taken with target's blk_new() */ + /* Required permissions are already taken by block-copy-state target */ block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL, &error_abort); job->len =3D len; @@ -789,10 +889,6 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, return &job->common; =20 error: - if (copy_bitmap) { - assert(!job || !job->copy_bitmap); - bdrv_release_dirty_bitmap(bs, copy_bitmap); - } if (sync_bitmap) { bdrv_reclaim_dirty_bitmap(bs, sync_bitmap, NULL); } diff --git a/block/trace-events b/block/trace-events index 3aa27e6b1e..cec8e40dba 100644 --- a/block/trace-events +++ b/block/trace-events @@ -40,12 +40,12 @@ mirror_yield_in_flight(void *s, int64_t offset, int in_= flight) "s %p offset %" P # backup.c backup_do_cow_enter(void *job, int64_t start, int64_t offset, uint64_t byt= es) "job %p start %" PRId64 " offset %" PRId64 " bytes %" PRIu64 backup_do_cow_return(void *job, int64_t offset, uint64_t bytes, int ret) "= job %p offset %" PRId64 " bytes %" PRIu64 " ret %d" -backup_do_cow_skip(void *job, int64_t start) "job %p start %"PRId64 -backup_do_cow_skip_range(void *job, int64_t start, uint64_t bytes) "job %p= start %"PRId64" bytes %"PRId64 -backup_do_cow_process(void *job, int64_t start) "job %p start %"PRId64 -backup_do_cow_read_fail(void *job, int64_t start, int ret) "job %p start %= "PRId64" ret %d" -backup_do_cow_write_fail(void *job, int64_t start, int ret) "job %p start = %"PRId64" ret %d" -backup_do_cow_copy_range_fail(void *job, int64_t start, int ret) "job %p s= tart %"PRId64" ret %d" +block_copy_skip(void *bcs, int64_t start) "bcs %p start %"PRId64 +block_copy_skip_range(void *bcs, int64_t start, uint64_t bytes) "bcs %p st= art %"PRId64" bytes %"PRId64 +block_copy_process(void *bcs, int64_t start) "bcs %p start %"PRId64 +block_copy_with_bounce_buffer_read_fail(void *bcs, int64_t start, int ret)= "bcs %p start %"PRId64" ret %d" +block_copy_with_bounce_buffer_write_fail(void *bcs, int64_t start, int ret= ) "bcs %p start %"PRId64" ret %d" +block_copy_with_offload_fail(void *bcs, int64_t start, int ret) "bcs %p st= art %"PRId64" ret %d" =20 # ../blockdev.c qmp_block_job_cancel(void *job) "job %p" --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709087; cv=none; d=zoho.com; s=zohoarc; b=KgL1MRlxOHb36CXQ3C7bSF/TBAGVfKqKCYsfBtksYYl+KVXhCkdb6EYgoBQl8GfteBd4+dp3LKXTmEcFReu01x6wU1jKafkmcPrA70Zjjtiwp80hvqqgXRwGi0RYvQStZCYFXdwoGqjUbp4+IFLf40L4s7/KR8X99RxGXFFyj7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709087; 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; bh=oQ37pUlwvi4u2aE/sMe40YAUauMsrhh3sMP3aU8vCDQ=; b=bGKO+vkLCjn5h16OcTP7FAXZllKJMDLs5ctlhnF83Ls6sO8VRz1q1XCNLKklvff2NWop1j3AXtRaKqxNuNLRrxpxjQx1baFs0mFv3e7TK7ulWvuxKzajXMzf4e4e63+sPRL+ynSTPlgMByk2OhOS1qiVJ5NKgBJYLYImAn9Z07M= 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 1570709087727337.3833279061005; Thu, 10 Oct 2019 05:04:47 -0700 (PDT) Received: from localhost ([::1]:36878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXBU-0003lw-3e for importer@patchew.org; Thu, 10 Oct 2019 08:04:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51793) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWr0-0006aP-I9 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWqx-0008BI-Pe for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55910) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqt-0008AB-Kt; Thu, 10 Oct 2019 07:43:27 -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 DDEAB883C2; Thu, 10 Oct 2019 11:43:26 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 838375C231; Thu, 10 Oct 2019 11:43:26 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 11/36] block/backup: fix block-comment style Date: Thu, 10 Oct 2019 13:42:35 +0200 Message-Id: <20191010114300.7746-12-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.26]); Thu, 10 Oct 2019 11:43:26 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 We need to fix comment style around block-copy functions before further moving them to separate file to satisfy checkpatch. But do more: fix all comments style. Also, seems like doubled first asterisk is not forbidden, but drop it too for consistency. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190920142056.12778-7-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/backup.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/block/backup.c b/block/backup.c index 5dda1673ca..f5125984db 100644 --- a/block/backup.c +++ b/block/backup.c @@ -223,8 +223,10 @@ fail: return NULL; } =20 -/* Copy range to target with a bounce buffer and return the bytes copied. = If - * error occurred, return a negative error number */ +/* + * Copy range to target with a bounce buffer and return the bytes copied. = If + * error occurred, return a negative error number + */ static int coroutine_fn block_copy_with_bounce_buffer(BlockCopyState *s, int64_t start, int64_t end, @@ -269,8 +271,10 @@ fail: =20 } =20 -/* Copy range to target and return the bytes copied. If error occurred, re= turn a - * negative error number. */ +/* + * Copy range to target and return the bytes copied. If error occurred, re= turn a + * negative error number. + */ static int coroutine_fn block_copy_with_offload(BlockCopyState *s, int64_t start, int64_t end, @@ -341,7 +345,7 @@ static int block_copy_is_cluster_allocated(BlockCopySta= te *s, int64_t offset, } } =20 -/** +/* * Reset bits in copy_bitmap starting at offset if they represent unalloca= ted * data in the image. May reset subsequent contiguous bits. * @return 0 when the cluster at @offset was unallocated, @@ -592,8 +596,10 @@ static bool coroutine_fn yield_and_check(BackupBlockJo= b *job) return true; } =20 - /* We need to yield even for delay_ns =3D 0 so that bdrv_drain_all() c= an - * return. Without a yield, the VM would not reboot. */ + /* + * We need to yield even for delay_ns =3D 0 so that bdrv_drain_all() c= an + * return. Without a yield, the VM would not reboot. + */ delay_ns =3D block_job_ratelimit_get_delay(&job->common, job->bytes_re= ad); job->bytes_read =3D 0; job_sleep_ns(&job->common.job, delay_ns); @@ -692,11 +698,15 @@ static int coroutine_fn backup_run(Job *job, Error **= errp) } =20 if (s->sync_mode =3D=3D MIRROR_SYNC_MODE_NONE) { - /* All bits are set in copy_bitmap to allow any cluster to be copi= ed. - * This does not actually require them to be copied. */ + /* + * All bits are set in copy_bitmap to allow any cluster to be copi= ed. + * This does not actually require them to be copied. + */ while (!job_is_cancelled(job)) { - /* Yield until the job is cancelled. We just let our before_w= rite - * notify callback service CoW requests. */ + /* + * Yield until the job is cancelled. We just let our before_w= rite + * notify callback service CoW requests. + */ job_yield(job); } } else { --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709921; cv=none; d=zoho.com; s=zohoarc; b=Pfp+M65acEdm1grcbr5VCL/I76xr6BuB8VBOiNuuDxPVsL3+Lg/uUyLC0/zOmuXYI9Wjl/XjnNOg5qVanb4op+dZ1i7DppJx+k/6vVpOVpBz3FSy7epJx2nOVead87tlRSeoGxcprMg6RXHcHZeeTCD+jMot/QDg56sFLQJtfQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709921; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yvHg5n9zQCnh9Pz9wE+vVBn92fRORoxthtsnbmOgicA=; b=meQxxLb3UFjFV67zp8Ab+fg/emB9z+G2IYyb4SFuKTN8c7Qi6C/59RIUHuXFt978krrB7JsNdZ8hlR9roQDe51khIz++dYg7lefAP3Qvs5mnDhSjy0U5XZNvLq3v+UOstXBr2Ts5dUQUh3XzBxdFHSidkdlYVHJgTomrj53p9EE= 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 1570709921611847.0467856259727; Thu, 10 Oct 2019 05:18:41 -0700 (PDT) Received: from localhost ([::1]:37038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXOy-0002s7-0E for importer@patchew.org; Thu, 10 Oct 2019 08:18:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51865) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWr7-0006dE-BI for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWr3-0008Cz-Rt for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37212) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqw-0008Au-9P; Thu, 10 Oct 2019 07:43:30 -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 62C5B3D955; Thu, 10 Oct 2019 11:43:29 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E28319C4F; Thu, 10 Oct 2019 11:43:28 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 12/36] block: move block_copy from block/backup.c to separate file Date: Thu, 10 Oct 2019 13:42:36 +0200 Message-Id: <20191010114300.7746-13-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.30]); Thu, 10 Oct 2019 11:43:29 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Split block_copy to separate file, to be cleanly shared with backup-top filter driver in further commits. It's a clean movement, the only change is drop "static" from interface functions. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190920142056.12778-8-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block/Makefile.objs | 1 + include/block/block-copy.h | 76 ++++++++ block/backup.c | 355 +------------------------------------ block/block-copy.c | 333 ++++++++++++++++++++++++++++++++++ block/trace-events | 2 + 5 files changed, 413 insertions(+), 354 deletions(-) create mode 100644 include/block/block-copy.h create mode 100644 block/block-copy.c diff --git a/block/Makefile.objs b/block/Makefile.objs index c2eb8c8769..f06f1fa1ac 100644 --- a/block/Makefile.objs +++ b/block/Makefile.objs @@ -37,6 +37,7 @@ block-obj-y +=3D write-threshold.o block-obj-y +=3D backup.o block-obj-$(CONFIG_REPLICATION) +=3D replication.o block-obj-y +=3D throttle.o copy-on-read.o +block-obj-y +=3D block-copy.o =20 block-obj-y +=3D crypto.o =20 diff --git a/include/block/block-copy.h b/include/block/block-copy.h new file mode 100644 index 0000000000..54f90d0c9a --- /dev/null +++ b/include/block/block-copy.h @@ -0,0 +1,76 @@ +/* + * block_copy API + * + * Copyright (C) 2013 Proxmox Server Solutions + * Copyright (c) 2019 Virtuozzo International GmbH. + * + * Authors: + * Dietmar Maurer (dietmar@proxmox.com) + * Vladimir Sementsov-Ogievskiy + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#ifndef BLOCK_COPY_H +#define BLOCK_COPY_H + +#include "block/block.h" + +typedef void (*ProgressBytesCallbackFunc)(int64_t bytes, void *opaque); +typedef void (*ProgressResetCallbackFunc)(void *opaque); +typedef struct BlockCopyState { + BlockBackend *source; + BlockBackend *target; + BdrvDirtyBitmap *copy_bitmap; + int64_t cluster_size; + bool use_copy_range; + int64_t copy_range_size; + uint64_t len; + + BdrvRequestFlags write_flags; + + /* + * skip_unallocated: + * + * Used by sync=3Dtop jobs, which first scan the source node for unall= ocated + * areas and clear them in the copy_bitmap. During this process, the = bitmap + * is thus not fully initialized: It may still have bits set for areas= that + * are unallocated and should actually not be copied. + * + * This is indicated by skip_unallocated. + * + * In this case, block_copy() will query the source=E2=80=99s allocati= on status, + * skip unallocated regions, clear them in the copy_bitmap, and invoke + * block_copy_reset_unallocated() every time it does. + */ + bool skip_unallocated; + + /* progress_bytes_callback: called when some copying progress is done.= */ + ProgressBytesCallbackFunc progress_bytes_callback; + + /* + * progress_reset_callback: called when some bytes reset from copy_bit= map + * (see @skip_unallocated above). The callee is assumed to recalculate= how + * many bytes remain based on the dirty bit count of copy_bitmap. + */ + ProgressResetCallbackFunc progress_reset_callback; + void *progress_opaque; +} BlockCopyState; + +BlockCopyState *block_copy_state_new( + BlockDriverState *source, BlockDriverState *target, + int64_t cluster_size, BdrvRequestFlags write_flags, + ProgressBytesCallbackFunc progress_bytes_callback, + ProgressResetCallbackFunc progress_reset_callback, + void *progress_opaque, Error **errp); + +void block_copy_state_free(BlockCopyState *s); + +int64_t block_copy_reset_unallocated(BlockCopyState *s, + int64_t offset, int64_t *count); + +int coroutine_fn block_copy(BlockCopyState *s, int64_t start, uint64_t byt= es, + bool *error_is_read, bool is_write_notifier); + +#endif /* BLOCK_COPY_H */ diff --git a/block/backup.c b/block/backup.c index f5125984db..4613b8c88d 100644 --- a/block/backup.c +++ b/block/backup.c @@ -18,6 +18,7 @@ #include "block/block_int.h" #include "block/blockjob_int.h" #include "block/block_backup.h" +#include "block/block-copy.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" #include "qemu/ratelimit.h" @@ -35,47 +36,6 @@ typedef struct CowRequest { CoQueue wait_queue; /* coroutines blocked on this request */ } CowRequest; =20 -typedef void (*ProgressBytesCallbackFunc)(int64_t bytes, void *opaque); -typedef void (*ProgressResetCallbackFunc)(void *opaque); -typedef struct BlockCopyState { - BlockBackend *source; - BlockBackend *target; - BdrvDirtyBitmap *copy_bitmap; - int64_t cluster_size; - bool use_copy_range; - int64_t copy_range_size; - uint64_t len; - - BdrvRequestFlags write_flags; - - /* - * skip_unallocated: - * - * Used by sync=3Dtop jobs, which first scan the source node for unall= ocated - * areas and clear them in the copy_bitmap. During this process, the = bitmap - * is thus not fully initialized: It may still have bits set for areas= that - * are unallocated and should actually not be copied. - * - * This is indicated by skip_unallocated. - * - * In this case, block_copy() will query the source=E2=80=99s allocati= on status, - * skip unallocated regions, clear them in the copy_bitmap, and invoke - * block_copy_reset_unallocated() every time it does. - */ - bool skip_unallocated; - - /* progress_bytes_callback: called when some copying progress is done.= */ - ProgressBytesCallbackFunc progress_bytes_callback; - - /* - * progress_reset_callback: called when some bytes reset from copy_bit= map - * (see @skip_unallocated above). The callee is assumed to recalculate= how - * many bytes remain based on the dirty bit count of copy_bitmap. - */ - ProgressResetCallbackFunc progress_reset_callback; - void *progress_opaque; -} BlockCopyState; - typedef struct BackupBlockJob { BlockJob common; BlockDriverState *source_bs; @@ -135,319 +95,6 @@ static void cow_request_end(CowRequest *req) qemu_co_queue_restart_all(&req->wait_queue); } =20 -static void block_copy_state_free(BlockCopyState *s) -{ - if (!s) { - return; - } - - bdrv_release_dirty_bitmap(blk_bs(s->source), s->copy_bitmap); - blk_unref(s->source); - blk_unref(s->target); - g_free(s); -} - -static BlockCopyState *block_copy_state_new( - BlockDriverState *source, BlockDriverState *target, - int64_t cluster_size, BdrvRequestFlags write_flags, - ProgressBytesCallbackFunc progress_bytes_callback, - ProgressResetCallbackFunc progress_reset_callback, - void *progress_opaque, Error **errp) -{ - BlockCopyState *s; - int ret; - uint64_t no_resize =3D BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE | - BLK_PERM_WRITE_UNCHANGED | BLK_PERM_GRAPH_MOD; - BdrvDirtyBitmap *copy_bitmap; - - copy_bitmap =3D bdrv_create_dirty_bitmap(source, cluster_size, NULL, e= rrp); - if (!copy_bitmap) { - return NULL; - } - bdrv_disable_dirty_bitmap(copy_bitmap); - - s =3D g_new(BlockCopyState, 1); - *s =3D (BlockCopyState) { - .source =3D blk_new(bdrv_get_aio_context(source), - BLK_PERM_CONSISTENT_READ, no_resize), - .target =3D blk_new(bdrv_get_aio_context(target), - BLK_PERM_WRITE, no_resize), - .copy_bitmap =3D copy_bitmap, - .cluster_size =3D cluster_size, - .len =3D bdrv_dirty_bitmap_size(copy_bitmap), - .write_flags =3D write_flags, - .progress_bytes_callback =3D progress_bytes_callback, - .progress_reset_callback =3D progress_reset_callback, - .progress_opaque =3D progress_opaque, - }; - - s->copy_range_size =3D QEMU_ALIGN_DOWN(MIN(blk_get_max_transfer(s->sou= rce), - blk_get_max_transfer(s->targe= t)), - s->cluster_size); - /* - * Set use_copy_range, consider the following: - * 1. Compression is not supported for copy_range. - * 2. copy_range does not respect max_transfer (it's a TODO), so we fa= ctor - * that in here. If max_transfer is smaller than the job->cluster_s= ize, - * we do not use copy_range (in that case it's zero after aligning = down - * above). - */ - s->use_copy_range =3D - !(write_flags & BDRV_REQ_WRITE_COMPRESSED) && s->copy_range_size >= 0; - - /* - * We just allow aio context change on our block backends. block_copy(= ) user - * (now it's only backup) is responsible for source and target being i= n same - * aio context. - */ - blk_set_disable_request_queuing(s->source, true); - blk_set_allow_aio_context_change(s->source, true); - blk_set_disable_request_queuing(s->target, true); - blk_set_allow_aio_context_change(s->target, true); - - ret =3D blk_insert_bs(s->source, source, errp); - if (ret < 0) { - goto fail; - } - - ret =3D blk_insert_bs(s->target, target, errp); - if (ret < 0) { - goto fail; - } - - return s; - -fail: - block_copy_state_free(s); - - return NULL; -} - -/* - * Copy range to target with a bounce buffer and return the bytes copied. = If - * error occurred, return a negative error number - */ -static int coroutine_fn block_copy_with_bounce_buffer(BlockCopyState *s, - int64_t start, - int64_t end, - bool is_write_notifi= er, - bool *error_is_read, - void **bounce_buffer) -{ - int ret; - int nbytes; - int read_flags =3D is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0; - - assert(QEMU_IS_ALIGNED(start, s->cluster_size)); - bdrv_reset_dirty_bitmap(s->copy_bitmap, start, s->cluster_size); - nbytes =3D MIN(s->cluster_size, s->len - start); - if (!*bounce_buffer) { - *bounce_buffer =3D blk_blockalign(s->source, s->cluster_size); - } - - ret =3D blk_co_pread(s->source, start, nbytes, *bounce_buffer, read_fl= ags); - if (ret < 0) { - trace_block_copy_with_bounce_buffer_read_fail(s, start, ret); - if (error_is_read) { - *error_is_read =3D true; - } - goto fail; - } - - ret =3D blk_co_pwrite(s->target, start, nbytes, *bounce_buffer, - s->write_flags); - if (ret < 0) { - trace_block_copy_with_bounce_buffer_write_fail(s, start, ret); - if (error_is_read) { - *error_is_read =3D false; - } - goto fail; - } - - return nbytes; -fail: - bdrv_set_dirty_bitmap(s->copy_bitmap, start, s->cluster_size); - return ret; - -} - -/* - * Copy range to target and return the bytes copied. If error occurred, re= turn a - * negative error number. - */ -static int coroutine_fn block_copy_with_offload(BlockCopyState *s, - int64_t start, - int64_t end, - bool is_write_notifier) -{ - int ret; - int nr_clusters; - int nbytes; - int read_flags =3D is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0; - - assert(QEMU_IS_ALIGNED(s->copy_range_size, s->cluster_size)); - assert(QEMU_IS_ALIGNED(start, s->cluster_size)); - nbytes =3D MIN(s->copy_range_size, MIN(end, s->len) - start); - nr_clusters =3D DIV_ROUND_UP(nbytes, s->cluster_size); - bdrv_reset_dirty_bitmap(s->copy_bitmap, start, - s->cluster_size * nr_clusters); - ret =3D blk_co_copy_range(s->source, start, s->target, start, nbytes, - read_flags, s->write_flags); - if (ret < 0) { - trace_block_copy_with_offload_fail(s, start, ret); - bdrv_set_dirty_bitmap(s->copy_bitmap, start, - s->cluster_size * nr_clusters); - return ret; - } - - return nbytes; -} - -/* - * Check if the cluster starting at offset is allocated or not. - * return via pnum the number of contiguous clusters sharing this allocati= on. - */ -static int block_copy_is_cluster_allocated(BlockCopyState *s, int64_t offs= et, - int64_t *pnum) -{ - BlockDriverState *bs =3D blk_bs(s->source); - int64_t count, total_count =3D 0; - int64_t bytes =3D s->len - offset; - int ret; - - assert(QEMU_IS_ALIGNED(offset, s->cluster_size)); - - while (true) { - ret =3D bdrv_is_allocated(bs, offset, bytes, &count); - if (ret < 0) { - return ret; - } - - total_count +=3D count; - - if (ret || count =3D=3D 0) { - /* - * ret: partial segment(s) are considered allocated. - * otherwise: unallocated tail is treated as an entire segment. - */ - *pnum =3D DIV_ROUND_UP(total_count, s->cluster_size); - return ret; - } - - /* Unallocated segment(s) with uncertain following segment(s) */ - if (total_count >=3D s->cluster_size) { - *pnum =3D total_count / s->cluster_size; - return 0; - } - - offset +=3D count; - bytes -=3D count; - } -} - -/* - * Reset bits in copy_bitmap starting at offset if they represent unalloca= ted - * data in the image. May reset subsequent contiguous bits. - * @return 0 when the cluster at @offset was unallocated, - * 1 otherwise, and -ret on error. - */ -static int64_t block_copy_reset_unallocated(BlockCopyState *s, - int64_t offset, int64_t *count) -{ - int ret; - int64_t clusters, bytes; - - ret =3D block_copy_is_cluster_allocated(s, offset, &clusters); - if (ret < 0) { - return ret; - } - - bytes =3D clusters * s->cluster_size; - - if (!ret) { - bdrv_reset_dirty_bitmap(s->copy_bitmap, offset, bytes); - s->progress_reset_callback(s->progress_opaque); - } - - *count =3D bytes; - return ret; -} - -static int coroutine_fn block_copy(BlockCopyState *s, - int64_t start, uint64_t bytes, - bool *error_is_read, - bool is_write_notifier) -{ - int ret =3D 0; - int64_t end =3D bytes + start; /* bytes */ - void *bounce_buffer =3D NULL; - int64_t status_bytes; - - /* - * block_copy() user is responsible for keeping source and target in s= ame - * aio context - */ - assert(blk_get_aio_context(s->source) =3D=3D blk_get_aio_context(s->ta= rget)); - - assert(QEMU_IS_ALIGNED(start, s->cluster_size)); - assert(QEMU_IS_ALIGNED(end, s->cluster_size)); - - while (start < end) { - int64_t dirty_end; - - if (!bdrv_dirty_bitmap_get(s->copy_bitmap, start)) { - trace_block_copy_skip(s, start); - start +=3D s->cluster_size; - continue; /* already copied */ - } - - dirty_end =3D bdrv_dirty_bitmap_next_zero(s->copy_bitmap, start, - (end - start)); - if (dirty_end < 0) { - dirty_end =3D end; - } - - if (s->skip_unallocated) { - ret =3D block_copy_reset_unallocated(s, start, &status_bytes); - if (ret =3D=3D 0) { - trace_block_copy_skip_range(s, start, status_bytes); - start +=3D status_bytes; - continue; - } - /* Clamp to known allocated region */ - dirty_end =3D MIN(dirty_end, start + status_bytes); - } - - trace_block_copy_process(s, start); - - if (s->use_copy_range) { - ret =3D block_copy_with_offload(s, start, dirty_end, - is_write_notifier); - if (ret < 0) { - s->use_copy_range =3D false; - } - } - if (!s->use_copy_range) { - ret =3D block_copy_with_bounce_buffer(s, start, dirty_end, - is_write_notifier, - error_is_read, &bounce_buf= fer); - } - if (ret < 0) { - break; - } - - start +=3D ret; - s->progress_bytes_callback(ret, s->progress_opaque); - ret =3D 0; - } - - if (bounce_buffer) { - qemu_vfree(bounce_buffer); - } - - return ret; -} - static void backup_progress_bytes_callback(int64_t bytes, void *opaque) { BackupBlockJob *s =3D opaque; diff --git a/block/block-copy.c b/block/block-copy.c new file mode 100644 index 0000000000..3fc9152853 --- /dev/null +++ b/block/block-copy.c @@ -0,0 +1,333 @@ +/* + * block_copy API + * + * Copyright (C) 2013 Proxmox Server Solutions + * Copyright (c) 2019 Virtuozzo International GmbH. + * + * Authors: + * Dietmar Maurer (dietmar@proxmox.com) + * Vladimir Sementsov-Ogievskiy + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" + +#include "trace.h" +#include "qapi/error.h" +#include "block/block-copy.h" +#include "sysemu/block-backend.h" + +void block_copy_state_free(BlockCopyState *s) +{ + if (!s) { + return; + } + + bdrv_release_dirty_bitmap(blk_bs(s->source), s->copy_bitmap); + blk_unref(s->source); + blk_unref(s->target); + g_free(s); +} + +BlockCopyState *block_copy_state_new( + BlockDriverState *source, BlockDriverState *target, + int64_t cluster_size, BdrvRequestFlags write_flags, + ProgressBytesCallbackFunc progress_bytes_callback, + ProgressResetCallbackFunc progress_reset_callback, + void *progress_opaque, Error **errp) +{ + BlockCopyState *s; + int ret; + uint64_t no_resize =3D BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE | + BLK_PERM_WRITE_UNCHANGED | BLK_PERM_GRAPH_MOD; + BdrvDirtyBitmap *copy_bitmap; + + copy_bitmap =3D bdrv_create_dirty_bitmap(source, cluster_size, NULL, e= rrp); + if (!copy_bitmap) { + return NULL; + } + bdrv_disable_dirty_bitmap(copy_bitmap); + + s =3D g_new(BlockCopyState, 1); + *s =3D (BlockCopyState) { + .source =3D blk_new(bdrv_get_aio_context(source), + BLK_PERM_CONSISTENT_READ, no_resize), + .target =3D blk_new(bdrv_get_aio_context(target), + BLK_PERM_WRITE, no_resize), + .copy_bitmap =3D copy_bitmap, + .cluster_size =3D cluster_size, + .len =3D bdrv_dirty_bitmap_size(copy_bitmap), + .write_flags =3D write_flags, + .progress_bytes_callback =3D progress_bytes_callback, + .progress_reset_callback =3D progress_reset_callback, + .progress_opaque =3D progress_opaque, + }; + + s->copy_range_size =3D QEMU_ALIGN_DOWN(MIN(blk_get_max_transfer(s->sou= rce), + blk_get_max_transfer(s->targe= t)), + s->cluster_size); + /* + * Set use_copy_range, consider the following: + * 1. Compression is not supported for copy_range. + * 2. copy_range does not respect max_transfer (it's a TODO), so we fa= ctor + * that in here. If max_transfer is smaller than the job->cluster_s= ize, + * we do not use copy_range (in that case it's zero after aligning = down + * above). + */ + s->use_copy_range =3D + !(write_flags & BDRV_REQ_WRITE_COMPRESSED) && s->copy_range_size >= 0; + + /* + * We just allow aio context change on our block backends. block_copy(= ) user + * (now it's only backup) is responsible for source and target being i= n same + * aio context. + */ + blk_set_disable_request_queuing(s->source, true); + blk_set_allow_aio_context_change(s->source, true); + blk_set_disable_request_queuing(s->target, true); + blk_set_allow_aio_context_change(s->target, true); + + ret =3D blk_insert_bs(s->source, source, errp); + if (ret < 0) { + goto fail; + } + + ret =3D blk_insert_bs(s->target, target, errp); + if (ret < 0) { + goto fail; + } + + return s; + +fail: + block_copy_state_free(s); + + return NULL; +} + +/* + * Copy range to target with a bounce buffer and return the bytes copied. = If + * error occurred, return a negative error number + */ +static int coroutine_fn block_copy_with_bounce_buffer(BlockCopyState *s, + int64_t start, + int64_t end, + bool is_write_notifi= er, + bool *error_is_read, + void **bounce_buffer) +{ + int ret; + int nbytes; + int read_flags =3D is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0; + + assert(QEMU_IS_ALIGNED(start, s->cluster_size)); + bdrv_reset_dirty_bitmap(s->copy_bitmap, start, s->cluster_size); + nbytes =3D MIN(s->cluster_size, s->len - start); + if (!*bounce_buffer) { + *bounce_buffer =3D blk_blockalign(s->source, s->cluster_size); + } + + ret =3D blk_co_pread(s->source, start, nbytes, *bounce_buffer, read_fl= ags); + if (ret < 0) { + trace_block_copy_with_bounce_buffer_read_fail(s, start, ret); + if (error_is_read) { + *error_is_read =3D true; + } + goto fail; + } + + ret =3D blk_co_pwrite(s->target, start, nbytes, *bounce_buffer, + s->write_flags); + if (ret < 0) { + trace_block_copy_with_bounce_buffer_write_fail(s, start, ret); + if (error_is_read) { + *error_is_read =3D false; + } + goto fail; + } + + return nbytes; +fail: + bdrv_set_dirty_bitmap(s->copy_bitmap, start, s->cluster_size); + return ret; + +} + +/* + * Copy range to target and return the bytes copied. If error occurred, re= turn a + * negative error number. + */ +static int coroutine_fn block_copy_with_offload(BlockCopyState *s, + int64_t start, + int64_t end, + bool is_write_notifier) +{ + int ret; + int nr_clusters; + int nbytes; + int read_flags =3D is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0; + + assert(QEMU_IS_ALIGNED(s->copy_range_size, s->cluster_size)); + assert(QEMU_IS_ALIGNED(start, s->cluster_size)); + nbytes =3D MIN(s->copy_range_size, MIN(end, s->len) - start); + nr_clusters =3D DIV_ROUND_UP(nbytes, s->cluster_size); + bdrv_reset_dirty_bitmap(s->copy_bitmap, start, + s->cluster_size * nr_clusters); + ret =3D blk_co_copy_range(s->source, start, s->target, start, nbytes, + read_flags, s->write_flags); + if (ret < 0) { + trace_block_copy_with_offload_fail(s, start, ret); + bdrv_set_dirty_bitmap(s->copy_bitmap, start, + s->cluster_size * nr_clusters); + return ret; + } + + return nbytes; +} + +/* + * Check if the cluster starting at offset is allocated or not. + * return via pnum the number of contiguous clusters sharing this allocati= on. + */ +static int block_copy_is_cluster_allocated(BlockCopyState *s, int64_t offs= et, + int64_t *pnum) +{ + BlockDriverState *bs =3D blk_bs(s->source); + int64_t count, total_count =3D 0; + int64_t bytes =3D s->len - offset; + int ret; + + assert(QEMU_IS_ALIGNED(offset, s->cluster_size)); + + while (true) { + ret =3D bdrv_is_allocated(bs, offset, bytes, &count); + if (ret < 0) { + return ret; + } + + total_count +=3D count; + + if (ret || count =3D=3D 0) { + /* + * ret: partial segment(s) are considered allocated. + * otherwise: unallocated tail is treated as an entire segment. + */ + *pnum =3D DIV_ROUND_UP(total_count, s->cluster_size); + return ret; + } + + /* Unallocated segment(s) with uncertain following segment(s) */ + if (total_count >=3D s->cluster_size) { + *pnum =3D total_count / s->cluster_size; + return 0; + } + + offset +=3D count; + bytes -=3D count; + } +} + +/* + * Reset bits in copy_bitmap starting at offset if they represent unalloca= ted + * data in the image. May reset subsequent contiguous bits. + * @return 0 when the cluster at @offset was unallocated, + * 1 otherwise, and -ret on error. + */ +int64_t block_copy_reset_unallocated(BlockCopyState *s, + int64_t offset, int64_t *count) +{ + int ret; + int64_t clusters, bytes; + + ret =3D block_copy_is_cluster_allocated(s, offset, &clusters); + if (ret < 0) { + return ret; + } + + bytes =3D clusters * s->cluster_size; + + if (!ret) { + bdrv_reset_dirty_bitmap(s->copy_bitmap, offset, bytes); + s->progress_reset_callback(s->progress_opaque); + } + + *count =3D bytes; + return ret; +} + +int coroutine_fn block_copy(BlockCopyState *s, + int64_t start, uint64_t bytes, + bool *error_is_read, + bool is_write_notifier) +{ + int ret =3D 0; + int64_t end =3D bytes + start; /* bytes */ + void *bounce_buffer =3D NULL; + int64_t status_bytes; + + /* + * block_copy() user is responsible for keeping source and target in s= ame + * aio context + */ + assert(blk_get_aio_context(s->source) =3D=3D blk_get_aio_context(s->ta= rget)); + + assert(QEMU_IS_ALIGNED(start, s->cluster_size)); + assert(QEMU_IS_ALIGNED(end, s->cluster_size)); + + while (start < end) { + int64_t dirty_end; + + if (!bdrv_dirty_bitmap_get(s->copy_bitmap, start)) { + trace_block_copy_skip(s, start); + start +=3D s->cluster_size; + continue; /* already copied */ + } + + dirty_end =3D bdrv_dirty_bitmap_next_zero(s->copy_bitmap, start, + (end - start)); + if (dirty_end < 0) { + dirty_end =3D end; + } + + if (s->skip_unallocated) { + ret =3D block_copy_reset_unallocated(s, start, &status_bytes); + if (ret =3D=3D 0) { + trace_block_copy_skip_range(s, start, status_bytes); + start +=3D status_bytes; + continue; + } + /* Clamp to known allocated region */ + dirty_end =3D MIN(dirty_end, start + status_bytes); + } + + trace_block_copy_process(s, start); + + if (s->use_copy_range) { + ret =3D block_copy_with_offload(s, start, dirty_end, + is_write_notifier); + if (ret < 0) { + s->use_copy_range =3D false; + } + } + if (!s->use_copy_range) { + ret =3D block_copy_with_bounce_buffer(s, start, dirty_end, + is_write_notifier, + error_is_read, &bounce_buf= fer); + } + if (ret < 0) { + break; + } + + start +=3D ret; + s->progress_bytes_callback(ret, s->progress_opaque); + ret =3D 0; + } + + if (bounce_buffer) { + qemu_vfree(bounce_buffer); + } + + return ret; +} diff --git a/block/trace-events b/block/trace-events index cec8e40dba..b8d70f5242 100644 --- a/block/trace-events +++ b/block/trace-events @@ -40,6 +40,8 @@ mirror_yield_in_flight(void *s, int64_t offset, int in_fl= ight) "s %p offset %" P # backup.c backup_do_cow_enter(void *job, int64_t start, int64_t offset, uint64_t byt= es) "job %p start %" PRId64 " offset %" PRId64 " bytes %" PRIu64 backup_do_cow_return(void *job, int64_t offset, uint64_t bytes, int ret) "= job %p offset %" PRId64 " bytes %" PRIu64 " ret %d" + +# block-copy.c block_copy_skip(void *bcs, int64_t start) "bcs %p start %"PRId64 block_copy_skip_range(void *bcs, int64_t start, uint64_t bytes) "bcs %p st= art %"PRId64" bytes %"PRId64 block_copy_process(void *bcs, int64_t start) "bcs %p start %"PRId64 --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709693; cv=none; d=zoho.com; s=zohoarc; b=J4/S190mpbrPTUL+Rpa7vsYpCQvZfcJuMfryrM5SKaDWxeIR5pM6eLSm8AAhWCXn+iqRTiInrsDCj7ofeGslgU6VVxaS76BIGx/uNG81p754fYsMrkQMBjhKqboiXJySo5zwJ/H8GhXxGjbqNypDvBLLggWsMBRbjdl1y6zPlPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709693; 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; bh=ad6EfyKu9nj2VDctuRNEbqd4SyP284z2/eTkr2+Byko=; b=kGwXAz8/sGIJcd5bclOVQ91b5TtWFw8y+eBjRtDPfbU6mK8nq3I4RbK/Df1m9FaLHaiOwFp/7weJaVCpa94VYUpoOQbPFuT1zZV7cRPQeP81wX1bZRT4zVQdv4ICf2WKeheahyW08Ozaxlmb/6syNK33sb9F5/lmPsevIm7lBd8= 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 1570709693978841.5536957409861; Thu, 10 Oct 2019 05:14:53 -0700 (PDT) Received: from localhost ([::1]:37000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXLD-0007WI-8F for importer@patchew.org; Thu, 10 Oct 2019 08:14:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51841) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWr5-0006cb-Jq for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWr3-0008Cu-Qu for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49946) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWqy-0008BE-7n; Thu, 10 Oct 2019 07:43:32 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F8A619D369; Thu, 10 Oct 2019 11:43:31 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1355860A9F; Thu, 10 Oct 2019 11:43:30 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 13/36] block: teach bdrv_debug_breakpoint skip filters with backing Date: Thu, 10 Oct 2019 13:42:37 +0200 Message-Id: <20191010114300.7746-14-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 10 Oct 2019 11:43:31 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Teach bdrv_debug_breakpoint and bdrv_debug_remove_breakpoint skip filters with backing. This is needed to implement and use in backup job it's own backup_top filter driver (like mirror already has one), and without this improvement, breakpoint removal will fail at least in 55 iotest. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190920142056.12778-9-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- block.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/block.c b/block.c index 5944124845..1c7c199849 100644 --- a/block.c +++ b/block.c @@ -5164,14 +5164,35 @@ void bdrv_debug_event(BlockDriverState *bs, Blkdebu= gEvent event) bs->drv->bdrv_debug_event(bs, event); } =20 -int bdrv_debug_breakpoint(BlockDriverState *bs, const char *event, - const char *tag) +static BlockDriverState *bdrv_find_debug_node(BlockDriverState *bs) { while (bs && bs->drv && !bs->drv->bdrv_debug_breakpoint) { - bs =3D bs->file ? bs->file->bs : NULL; + if (bs->file) { + bs =3D bs->file->bs; + continue; + } + + if (bs->drv->is_filter && bs->backing) { + bs =3D bs->backing->bs; + continue; + } + + break; } =20 if (bs && bs->drv && bs->drv->bdrv_debug_breakpoint) { + assert(bs->drv->bdrv_debug_remove_breakpoint); + return bs; + } + + return NULL; +} + +int bdrv_debug_breakpoint(BlockDriverState *bs, const char *event, + const char *tag) +{ + bs =3D bdrv_find_debug_node(bs); + if (bs) { return bs->drv->bdrv_debug_breakpoint(bs, event, tag); } =20 @@ -5180,11 +5201,8 @@ int bdrv_debug_breakpoint(BlockDriverState *bs, cons= t char *event, =20 int bdrv_debug_remove_breakpoint(BlockDriverState *bs, const char *tag) { - while (bs && bs->drv && !bs->drv->bdrv_debug_remove_breakpoint) { - bs =3D bs->file ? bs->file->bs : NULL; - } - - if (bs && bs->drv && bs->drv->bdrv_debug_remove_breakpoint) { + bs =3D bdrv_find_debug_node(bs); + if (bs) { return bs->drv->bdrv_debug_remove_breakpoint(bs, tag); } =20 --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710224; cv=none; d=zoho.com; s=zohoarc; b=nJc+I2Ix+WvT9l0sXAJbQd3VPBlmV7XV9SSe6imSvHaDphfg4vMZrO36fLxB9Px0SoOyd2RXGZh5/Bo5SaJqIa2kLVH/U9RkA6yhh97MDCU0qw+tQlzBWfXL9SIbdFFkfSbNYYxlkZsCMNGolFP+fUazy0KfQ7r4eY42PM8ru1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710224; 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; bh=bGeGvbDMT9eW6o/GDbX/UGjWP16VO3pL30TAKJ9V+0k=; b=kkuXpcfgvDqpCY+6BBUP8+AE7w/nWNs2xfR8MjR8naUQip5KRh+V+h5EG7DloaeLjKsQlQ6D4pFVUyVs1QQA+IlBID08xDimoTrl5a7dZ4BFllel50HuEtMr0imCXKqXWPKo0M+THz8+CBNSou59o7e1QUdwbASdK27aQQWNGZc= 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 1570710224690725.7958906464644; Thu, 10 Oct 2019 05:23:44 -0700 (PDT) Received: from localhost ([::1]:37142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXTp-00026z-1T for importer@patchew.org; Thu, 10 Oct 2019 08:23:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52011) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrG-0006qn-6L for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrB-0008Gk-L9 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40682) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWr2-0008Bu-2s; Thu, 10 Oct 2019 07:43:36 -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 4DF1A315C03D; Thu, 10 Oct 2019 11:43:34 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A4605C231; Thu, 10 Oct 2019 11:43:32 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 14/36] iotests: prepare 124 and 257 bitmap querying for backup-top filter Date: Thu, 10 Oct 2019 13:42:38 +0200 Message-Id: <20191010114300.7746-15-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.41]); Thu, 10 Oct 2019 11:43:34 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 After backup-top filter appearing it's not possible to see dirty bitmaps in top node, so use node-name instead. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190920142056.12778-10-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- tests/qemu-iotests/124 | 83 ++++---- tests/qemu-iotests/257 | 49 ++--- tests/qemu-iotests/257.out | 364 +++++++++++++--------------------- tests/qemu-iotests/iotests.py | 27 +++ 4 files changed, 219 insertions(+), 304 deletions(-) diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124 index ca40ba3be2..d3e851e1ae 100755 --- a/tests/qemu-iotests/124 +++ b/tests/qemu-iotests/124 @@ -105,7 +105,7 @@ class TestIncrementalBackupBase(iotests.QMPTestCase): # Create a base image with a distinctive patterning drive0 =3D self.add_node('drive0') self.img_create(drive0['file'], drive0['fmt']) - self.vm.add_drive(drive0['file']) + self.vm.add_drive(drive0['file'], opts=3D'node-name=3Dnode0') self.write_default_pattern(drive0['file']) self.vm.launch() =20 @@ -348,12 +348,14 @@ class TestIncrementalBackup(TestIncrementalBackupBase= ): ('0xfe', '16M', '256k'), ('0x64', '32736k', '64k'))) # Check the dirty bitmap stats - result =3D self.vm.qmp('query-block') - self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/name', 'bitmap= 0') - self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/count', 458752) - self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/granularity', = 65536) - self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/status', 'acti= ve') - self.assert_qmp(result, 'return[0]/dirty-bitmaps[0]/persistent', F= alse) + self.assertTrue(self.vm.check_bitmap_status( + 'node0', bitmap0.name, { + 'name': 'bitmap0', + 'count': 458752, + 'granularity': 65536, + 'status': 'active', + 'persistent': False + })) =20 # Prepare a cluster_size=3D128k backup target without a backing fi= le. (target, _) =3D bitmap0.new_target() @@ -670,9 +672,8 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBack= upBase): """ =20 drive0 =3D self.drives[0] - # NB: The blkdebug script here looks for a "flush, read, read" pat= tern. - # The flush occurs in hmp_io_writes, the first read in device_add,= and - # the last read during the block job. + # NB: The blkdebug script here looks for a "flush, read" pattern. + # The flush occurs in hmp_io_writes, and the read during the block= job. result =3D self.vm.qmp('blockdev-add', node_name=3Ddrive0['id'], driver=3Ddrive0['fmt'], @@ -686,15 +687,11 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBa= ckupBase): 'event': 'flush_to_disk', 'state': 1, 'new_state': 2 - },{ - 'event': 'read_aio', - 'state': 2, - 'new_state': 3 }], 'inject-error': [{ 'event': 'read_aio', 'errno': 5, - 'state': 3, + 'state': 2, 'immediately': False, 'once': True }], @@ -708,23 +705,15 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBa= ckupBase): ('0xfe', '16M', '256k'), ('0x64', '32736k', '64k'))) =20 - # For the purposes of query-block visibility of bitmaps, add a dri= ve - # frontend after we've written data; otherwise we can't use hmp-io - result =3D self.vm.qmp("device_add", - id=3D"device0", - drive=3Ddrive0['id'], - driver=3D"virtio-blk") - self.assert_qmp(result, 'return', {}) - # Bitmap Status Check - query =3D self.vm.qmp('query-block') - ret =3D [bmap for bmap in query['return'][0]['dirty-bitmaps'] - if bmap.get('name') =3D=3D bitmap.name][0] - self.assert_qmp(ret, 'count', 458752) - self.assert_qmp(ret, 'granularity', 65536) - self.assert_qmp(ret, 'status', 'active') - self.assert_qmp(ret, 'busy', False) - self.assert_qmp(ret, 'recording', True) + self.assertTrue(self.vm.check_bitmap_status( + drive0['id'], bitmap.name, { + 'count': 458752, + 'granularity': 65536, + 'status': 'active', + 'busy': False, + 'recording': True + })) =20 # Start backup parent, _ =3D bitmap.last_target() @@ -748,14 +737,14 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBa= ckupBase): 'operation': 'read'}) =20 # Bitmap Status Check - query =3D self.vm.qmp('query-block') - ret =3D [bmap for bmap in query['return'][0]['dirty-bitmaps'] - if bmap.get('name') =3D=3D bitmap.name][0] - self.assert_qmp(ret, 'count', 458752) - self.assert_qmp(ret, 'granularity', 65536) - self.assert_qmp(ret, 'status', 'frozen') - self.assert_qmp(ret, 'busy', True) - self.assert_qmp(ret, 'recording', True) + self.assertTrue(self.vm.check_bitmap_status( + drive0['id'], bitmap.name, { + 'count': 458752, + 'granularity': 65536, + 'status': 'frozen', + 'busy': True, + 'recording': True + })) =20 # Resume and check incremental backup for consistency res =3D self.vm.qmp('block-job-resume', device=3Dbitmap.drive['id'= ]) @@ -763,14 +752,14 @@ class TestIncrementalBackupBlkdebug(TestIncrementalBa= ckupBase): self.wait_qmp_backup(bitmap.drive['id']) =20 # Bitmap Status Check - query =3D self.vm.qmp('query-block') - ret =3D [bmap for bmap in query['return'][0]['dirty-bitmaps'] - if bmap.get('name') =3D=3D bitmap.name][0] - self.assert_qmp(ret, 'count', 0) - self.assert_qmp(ret, 'granularity', 65536) - self.assert_qmp(ret, 'status', 'active') - self.assert_qmp(ret, 'busy', False) - self.assert_qmp(ret, 'recording', True) + self.assertTrue(self.vm.check_bitmap_status( + drive0['id'], bitmap.name, { + 'count': 0, + 'granularity': 65536, + 'status': 'active', + 'busy': False, + 'recording': True + })) =20 # Finalize / Cleanup self.make_reference_backup(bitmap) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index 4a636d8ab2..6b368e1e70 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -188,25 +188,6 @@ class Drive: self.size =3D size self.node =3D name =20 -def query_bitmaps(vm): - res =3D vm.qmp("query-block") - return {"bitmaps": {device['device'] or device['qdev']: - device.get('dirty-bitmaps', []) for - device in res['return']}} - -def get_bitmap(bitmaps, drivename, name, recording=3DNone): - """ - get a specific bitmap from the object returned by query_bitmaps. - :param recording: If specified, filter results by the specified value. - """ - for bitmap in bitmaps['bitmaps'][drivename]: - if bitmap.get('name', '') =3D=3D name: - if recording is None: - return bitmap - elif bitmap.get('recording') =3D=3D recording: - return bitmap - return None - def blockdev_backup(vm, device, target, sync, **kwargs): # Strip any arguments explicitly nulled by the caller: kwargs =3D {key: val for key, val in kwargs.items() if val is not None} @@ -249,8 +230,8 @@ def perform_writes(drive, n): pattern.size) log(cmd) log(drive.vm.hmp_qemu_io(drive.name, cmd)) - bitmaps =3D query_bitmaps(drive.vm) - log(bitmaps, indent=3D2) + bitmaps =3D drive.vm.query_bitmaps() + log({'bitmaps': bitmaps}, indent=3D2) log('') return bitmaps =20 @@ -370,7 +351,7 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap',= failure=3DNone): # 1 - Writes and Reference Backup bitmaps =3D perform_writes(drive0, 1) ebitmap.dirty_group(1) - bitmap =3D get_bitmap(bitmaps, drive0.device, 'bitmap0') + bitmap =3D vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbitmaps) ebitmap.compare(bitmap) reference_backup(drive0, 1, fbackup1) =20 @@ -388,12 +369,13 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap= ', failure=3DNone): log('') bitmaps =3D perform_writes(drive0, 2) # Named bitmap (static, should be unchanged) - ebitmap.compare(get_bitmap(bitmaps, drive0.device, 'bitmap0')) + ebitmap.compare(vm.get_bitmap(drive0.node, 'bitmap0', + bitmaps=3Dbitmaps)) # Anonymous bitmap (dynamic, shows new writes) anonymous =3D EmulatedBitmap() anonymous.dirty_group(2) - anonymous.compare(get_bitmap(bitmaps, drive0.device, '', - recording=3DTrue)) + anonymous.compare(vm.get_bitmap(drive0.node, '', recording=3DT= rue, + bitmaps=3Dbitmaps)) =20 # Simulate the order in which this will happen: # group 1 gets cleared first, then group two gets written. @@ -405,8 +387,8 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap',= failure=3DNone): 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) - log(bitmaps, indent=3D2) + bitmaps =3D vm.query_bitmaps() + log({'bitmaps': bitmaps}, indent=3D2) log('') =20 if bsync_mode =3D=3D 'always' and failure =3D=3D 'intermediate': @@ -423,29 +405,30 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap= ', failure=3DNone): ebitmap.clear() ebitmap.dirty_bits(range(fail_bit, SIZE // GRANULARITY)) =20 - ebitmap.compare(get_bitmap(bitmaps, drive0.device, 'bitmap0')) + ebitmap.compare(vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbi= tmaps)) =20 # 2 - Writes and Reference Backup bitmaps =3D perform_writes(drive0, 3) ebitmap.dirty_group(3) - ebitmap.compare(get_bitmap(bitmaps, drive0.device, 'bitmap0')) + ebitmap.compare(vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbi= tmaps)) reference_backup(drive0, 2, fbackup2) =20 # 2 - Bitmap Backup (In failure modes, this is a recovery.) job =3D backup(drive0, 2, bsync2, "bitmap", bitmap=3D"bitmap0", bitmap_mode=3Dbsync_mode) vm.run_job(job, auto_dismiss=3DTrue, auto_finalize=3DFalse) - bitmaps =3D query_bitmaps(vm) - log(bitmaps, indent=3D2) + bitmaps =3D vm.query_bitmaps() + log({'bitmaps': bitmaps}, indent=3D2) log('') if bsync_mode !=3D 'never': ebitmap.clear() - ebitmap.compare(get_bitmap(bitmaps, drive0.device, 'bitmap0')) + ebitmap.compare(vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbi= tmaps)) =20 log('--- Cleanup ---\n') vm.qmp_log("block-dirty-bitmap-remove", node=3Ddrive0.name, name=3D"bitmap0") - log(query_bitmaps(vm), indent=3D2) + bitmaps =3D vm.query_bitmaps() + log({'bitmaps': bitmaps}, indent=3D2) vm.shutdown() log('') =20 diff --git a/tests/qemu-iotests/257.out b/tests/qemu-iotests/257.out index 84b79d7bfe..c9b4b68232 100644 --- a/tests/qemu-iotests/257.out +++ b/tests/qemu-iotests/257.out @@ -19,9 +19,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -55,7 +53,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -111,7 +109,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -153,7 +151,7 @@ expecting 7 dirty sectors; have 7. OK! {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 655360, @@ -182,7 +180,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 983040, @@ -231,7 +229,7 @@ expecting 15 dirty sectors; have 15. OK! {"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 983040, @@ -253,9 +251,7 @@ expecting 15 dirty sectors; have 15. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -285,9 +281,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -321,7 +315,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -370,7 +364,7 @@ expecting 6 dirty sectors; have 6. OK! {"data": {"device": "backup_1", "error": "Input/output error", "len": 3932= 16, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -399,7 +393,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 917504, @@ -448,7 +442,7 @@ expecting 14 dirty sectors; have 14. OK! {"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 917504, @@ -470,9 +464,7 @@ expecting 14 dirty sectors; have 14. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -502,9 +494,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -538,7 +528,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -594,7 +584,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -636,7 +626,7 @@ expecting 7 dirty sectors; have 7. OK! {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 655360, @@ -665,7 +655,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 983040, @@ -714,7 +704,7 @@ expecting 15 dirty sectors; have 15. OK! {"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 983040, @@ -736,9 +726,7 @@ expecting 15 dirty sectors; have 15. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -768,9 +756,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -804,7 +790,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -860,7 +846,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -902,7 +888,7 @@ expecting 7 dirty sectors; have 7. OK! {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 655360, @@ -931,7 +917,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 983040, @@ -980,7 +966,7 @@ expecting 15 dirty sectors; have 15. OK! {"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -1002,9 +988,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -1034,9 +1018,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -1070,7 +1052,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -1119,7 +1101,7 @@ expecting 6 dirty sectors; have 6. OK! {"data": {"device": "backup_1", "error": "Input/output error", "len": 3932= 16, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -1148,7 +1130,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 917504, @@ -1197,7 +1179,7 @@ expecting 14 dirty sectors; have 14. OK! {"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -1219,9 +1201,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -1251,9 +1231,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -1287,7 +1265,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -1343,7 +1321,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -1385,7 +1363,7 @@ expecting 7 dirty sectors; have 7. OK! {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 458752, @@ -1414,7 +1392,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 786432, @@ -1463,7 +1441,7 @@ expecting 12 dirty sectors; have 12. OK! {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -1485,9 +1463,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -1517,9 +1493,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -1553,7 +1527,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -1609,7 +1583,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -1651,7 +1625,7 @@ expecting 7 dirty sectors; have 7. OK! {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 458752, @@ -1680,7 +1654,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 786432, @@ -1729,7 +1703,7 @@ expecting 12 dirty sectors; have 12. OK! {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -1751,9 +1725,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -1783,9 +1755,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -1819,7 +1789,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -1868,7 +1838,7 @@ expecting 6 dirty sectors; have 6. OK! {"data": {"device": "backup_1", "error": "Input/output error", "len": 3932= 16, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 327680, @@ -1897,7 +1867,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 851968, @@ -1946,7 +1916,7 @@ expecting 13 dirty sectors; have 13. OK! {"data": {"device": "backup_2", "len": 851968, "offset": 851968, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -1968,9 +1938,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -2000,9 +1968,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -2036,7 +2002,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -2092,7 +2058,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -2134,7 +2100,7 @@ expecting 7 dirty sectors; have 7. OK! {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 458752, @@ -2163,7 +2129,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 786432, @@ -2212,7 +2178,7 @@ expecting 12 dirty sectors; have 12. OK! {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -2234,9 +2200,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -2266,9 +2230,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -2302,7 +2264,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -2358,7 +2320,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -2400,7 +2362,7 @@ expecting 7 dirty sectors; have 7. OK! {"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": [ + "drive0": [ { "busy": false, "count": 655360, @@ -2429,7 +2391,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 983040, @@ -2478,7 +2440,7 @@ expecting 15 dirty sectors; have 15. OK! {"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -2500,9 +2462,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -2532,9 +2492,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -2568,7 +2526,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -2617,7 +2575,7 @@ expecting 6 dirty sectors; have 6. OK! {"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": [ + "drive0": [ { "busy": false, "count": 393216, @@ -2646,7 +2604,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 917504, @@ -2695,7 +2653,7 @@ expecting 14 dirty sectors; have 14. OK! {"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -2717,9 +2675,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -2749,9 +2705,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -2785,7 +2739,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -2841,7 +2795,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -2883,7 +2837,7 @@ expecting 7 dirty sectors; have 7. OK! {"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": [ + "drive0": [ { "busy": false, "count": 458752, @@ -2912,7 +2866,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 786432, @@ -2961,7 +2915,7 @@ expecting 12 dirty sectors; have 12. OK! {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -2983,9 +2937,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -3015,9 +2967,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -3051,7 +3001,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -3107,7 +3057,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -3149,7 +3099,7 @@ expecting 7 dirty sectors; have 7. OK! {"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": [ + "drive0": [ { "busy": false, "count": 458752, @@ -3178,7 +3128,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 786432, @@ -3227,7 +3177,7 @@ expecting 12 dirty sectors; have 12. OK! {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -3249,9 +3199,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -3281,9 +3229,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -3317,7 +3263,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -3366,7 +3312,7 @@ expecting 6 dirty sectors; have 6. OK! {"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": [ + "drive0": [ { "busy": false, "count": 66125824, @@ -3395,7 +3341,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 66453504, @@ -3444,7 +3390,7 @@ expecting 1014 dirty sectors; have 1014. OK! {"data": {"device": "backup_2", "len": 66453504, "offset": 66453504, "spee= d": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"mi= croseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -3466,9 +3412,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -3498,9 +3442,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -3534,7 +3476,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -3590,7 +3532,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -3632,7 +3574,7 @@ expecting 7 dirty sectors; have 7. OK! {"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": [ + "drive0": [ { "busy": false, "count": 458752, @@ -3661,7 +3603,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 786432, @@ -3710,7 +3652,7 @@ expecting 12 dirty sectors; have 12. OK! {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -3732,9 +3674,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -3764,9 +3704,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -3800,7 +3738,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -3856,7 +3794,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -3898,7 +3836,7 @@ expecting 7 dirty sectors; have 7. OK! {"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 655360, @@ -3927,7 +3865,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 983040, @@ -3976,7 +3914,7 @@ expecting 15 dirty sectors; have 15. OK! {"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -3998,9 +3936,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -4030,9 +3966,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -4066,7 +4000,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -4115,7 +4049,7 @@ expecting 6 dirty sectors; have 6. OK! {"data": {"device": "backup_1", "error": "Input/output error", "len": 4587= 52, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -4144,7 +4078,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 917504, @@ -4193,7 +4127,7 @@ expecting 14 dirty sectors; have 14. OK! {"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -4215,9 +4149,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -4247,9 +4179,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -4283,7 +4213,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -4339,7 +4269,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -4381,7 +4311,7 @@ expecting 7 dirty sectors; have 7. OK! {"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 458752, @@ -4410,7 +4340,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 786432, @@ -4459,7 +4389,7 @@ expecting 12 dirty sectors; have 12. OK! {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -4481,9 +4411,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -4513,9 +4441,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -4549,7 +4475,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -4605,7 +4531,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -4647,7 +4573,7 @@ expecting 7 dirty sectors; have 7. OK! {"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 458752, @@ -4676,7 +4602,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 786432, @@ -4725,7 +4651,7 @@ expecting 12 dirty sectors; have 12. OK! {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -4747,9 +4673,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -4779,9 +4703,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -4815,7 +4737,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -4864,7 +4786,7 @@ expecting 6 dirty sectors; have 6. OK! {"data": {"device": "backup_1", "error": "Input/output error", "len": 4587= 52, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -4893,7 +4815,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 917504, @@ -4942,7 +4864,7 @@ expecting 14 dirty sectors; have 14. OK! {"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -4964,9 +4886,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- @@ -4996,9 +4916,7 @@ write -P0x6f 0x2000000 0x10000 write -P0x76 0x3ff0000 0x10000 {"return": ""} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Reference Backup #0 --- @@ -5032,7 +4950,7 @@ write -P0x69 0x3fe0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 393216, @@ -5088,7 +5006,7 @@ write -P0x67 0x3fe0000 0x20000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -5130,7 +5048,7 @@ expecting 7 dirty sectors; have 7. OK! {"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 458752, @@ -5159,7 +5077,7 @@ write -P0xdd 0x3fc0000 0x10000 {"return": ""} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 786432, @@ -5208,7 +5126,7 @@ expecting 12 dirty sectors; have 12. OK! {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} { "bitmaps": { - "device0": [ + "drive0": [ { "busy": false, "count": 0, @@ -5230,9 +5148,7 @@ expecting 0 dirty sectors; have 0. OK! {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", = "node": "drive0"}} {"return": {}} { - "bitmaps": { - "device0": [] - } + "bitmaps": {} } =20 --- Verification --- diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 9fb5181c3d..3a8f378f90 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -641,6 +641,33 @@ class VM(qtest.QEMUQtestMachine): return x return None =20 + def query_bitmaps(self): + res =3D self.qmp("query-named-block-nodes") + return {device['node-name']: device['dirty-bitmaps'] + for device in res['return'] if 'dirty-bitmaps' in device} + + def get_bitmap(self, node_name, bitmap_name, recording=3DNone, bitmaps= =3DNone): + """ + get a specific bitmap from the object returned by query_bitmaps. + :param recording: If specified, filter results by the specified va= lue. + :param bitmaps: If specified, use it instead of call query_bitmaps= () + """ + if bitmaps is None: + bitmaps =3D self.query_bitmaps() + + for bitmap in bitmaps[node_name]: + if bitmap.get('name', '') =3D=3D bitmap_name: + if recording is None: + return bitmap + elif bitmap.get('recording') =3D=3D recording: + return bitmap + return None + + def check_bitmap_status(self, node_name, bitmap_name, fields): + ret =3D self.get_bitmap(node_name, bitmap_name) + + return fields.items() <=3D ret.items() + =20 index_re =3D re.compile(r'([^\[]+)\[([^\]]+)\]') =20 --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710034; cv=none; d=zoho.com; s=zohoarc; b=AlL2Jnqiu1EazFIpWCcfCU6xa57vO5+sUqvJp1+5krlbWGh5jMw20hAsOX4mwNs6SC5dblpILNBG5jYIfHnTA4tI0kjCnQaPWftv8ovY8uxqkIWA1U4ccgNGUoyiBxKg1cNdN/3R2ugxxFUsQAyMW2bCMXHBnJSfihpSfMUAmCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710034; 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; bh=EceiwSwrsj+MsQqMlHXbWpOou2QNDanbd1Un0FFp8A0=; b=lsxS6iomPBmBJiODQ5VLQjfYqitcmq4pH40jt0ApWmZtZgCefwzhF6AONEIiF3aAwFmjJUDuAQz4eNNnEJ4FYi2WrnHUaNuTbHT2LXPPcSpVS08qWAOtoES6WYTiAnrNZPuEWtgnKDVHdlPa3f3CV2gBIQF4gbJF7Bm/M/dKoTM= 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 1570710034940339.3033013254802; Thu, 10 Oct 2019 05:20:34 -0700 (PDT) Received: from localhost ([::1]:37066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXQn-00068r-AU for importer@patchew.org; Thu, 10 Oct 2019 08:20:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51894) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWr9-0006dr-LF for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWr8-0008Ev-8j for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55060) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWr3-0008CW-2y; Thu, 10 Oct 2019 07:43:37 -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 560CB801663; Thu, 10 Oct 2019 11:43:36 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F10295D6B7; Thu, 10 Oct 2019 11:43:35 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 15/36] iotests: 257: drop unused Drive.device field Date: Thu, 10 Oct 2019 13:42:39 +0200 Message-Id: <20191010114300.7746-16-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.6.2 (mx1.redhat.com [10.5.110.67]); Thu, 10 Oct 2019 11:43:36 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 After previous commit Drive.device is actually unused. Drop it together with .name property. While being here reuse .node in qmp commands instead of writing 'drive0' twice. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190920142056.12778-11-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- tests/qemu-iotests/257 | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index 6b368e1e70..5d77202157 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -148,11 +148,6 @@ class Drive: self.fmt =3D None self.size =3D None self.node =3D None - self.device =3D None - - @property - def name(self): - return self.node or self.device =20 def img_create(self, fmt, size): self.fmt =3D fmt @@ -201,7 +196,7 @@ def blockdev_backup(vm, device, target, sync, **kwargs): def blockdev_backup_mktarget(drive, target_id, filepath, sync, **kwargs): target_drive =3D Drive(filepath, vm=3Ddrive.vm) target_drive.create_target(target_id, drive.fmt, drive.size) - blockdev_backup(drive.vm, drive.name, target_id, sync, **kwargs) + blockdev_backup(drive.vm, drive.node, target_id, sync, **kwargs) =20 def reference_backup(drive, n, filepath): log("--- Reference Backup #{:d} ---\n".format(n)) @@ -229,7 +224,7 @@ def perform_writes(drive, n): pattern.offset, pattern.size) log(cmd) - log(drive.vm.hmp_qemu_io(drive.name, cmd)) + log(drive.vm.hmp_qemu_io(drive.node, cmd)) bitmaps =3D drive.vm.query_bitmaps() log({'bitmaps': bitmaps}, indent=3D2) log('') @@ -324,18 +319,17 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap= ', failure=3DNone): }] } =20 + drive0.node =3D 'drive0' vm.qmp_log('blockdev-add', filters=3D[iotests.filter_qmp_testfiles], - node_name=3D"drive0", + node_name=3Ddrive0.node, driver=3Ddrive0.fmt, file=3Dfile_config) - drive0.node =3D 'drive0' - drive0.device =3D 'device0' # Use share-rw to allow writes directly to the node; # The anonymous block-backend for this configuration prevents us # from using HMP's qemu-io commands to address the device. - vm.qmp_log("device_add", id=3Ddrive0.device, - drive=3Ddrive0.name, driver=3D"scsi-hd", + vm.qmp_log("device_add", id=3D'device0', + drive=3Ddrive0.node, driver=3D"scsi-hd", share_rw=3DTrue) log('') =20 @@ -343,7 +337,7 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap',= failure=3DNone): perform_writes(drive0, 0) reference_backup(drive0, 0, fbackup0) log('--- Add Bitmap ---\n') - vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.name, + vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.node, name=3D"bitmap0", granularity=3DGRANULARITY) log('') ebitmap =3D EmulatedBitmap() @@ -358,7 +352,7 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap',= failure=3DNone): # 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(vm.hmp_qemu_io(drive0.node, 'flush')) log('') job =3D backup(drive0, 1, bsync1, msync_mode, bitmap=3D"bitmap0", bitmap_mode=3Dbsync_mode) @@ -426,7 +420,7 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap',= failure=3DNone): =20 log('--- Cleanup ---\n') vm.qmp_log("block-dirty-bitmap-remove", - node=3Ddrive0.name, name=3D"bitmap0") + node=3Ddrive0.node, name=3D"bitmap0") bitmaps =3D vm.query_bitmaps() log({'bitmaps': bitmaps}, indent=3D2) vm.shutdown() @@ -467,22 +461,21 @@ def test_backup_api(): 'filename': drive0.path } =20 + drive0.node =3D 'drive0' vm.qmp_log('blockdev-add', filters=3D[iotests.filter_qmp_testfiles], - node_name=3D"drive0", + node_name=3Ddrive0.node, 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") + vm.qmp_log("device_add", id=3D'device0', + drive=3Ddrive0.node, driver=3D"scsi-hd") log('') =20 target0 =3D Drive(backup_path, vm=3Dvm) target0.create_target("backup_target", drive0.fmt, drive0.size) log('') =20 - vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.name, + vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.node, name=3D"bitmap0", granularity=3DGRANULARITY) log('') =20 @@ -521,7 +514,7 @@ def test_backup_api(): log("-- Sync mode {:s} tests --\n".format(sync_mode)) for bitmap in (None, 'bitmap404', 'bitmap0'): for policy in error_cases[sync_mode][bitmap]: - blockdev_backup(drive0.vm, drive0.name, "backup_target= ", + blockdev_backup(drive0.vm, drive0.node, "backup_target= ", sync_mode, job_id=3D'api_job', bitmap=3Dbitmap, bitmap_mode=3Dpolicy) log('') --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709462; cv=none; d=zoho.com; s=zohoarc; b=iBFEhJgJEE36tTA/xkvr7JMrhIKazKfe8+6jBaP4XLgtRGPibtwdQAKg6PDJw+0h+KYrHnig4OQzN0KXG0MBKUJuPA125x8/r9aIi90UYGUcqdyXJGm72w/zTff03lIGn7NmrtuxFsjAHL8EQu+ATd4vCxtRpI+sV5cRHSwObG4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709462; 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; bh=ezQakynFXSHbtx9UoPIjzQrfyQbsXKP9PB9TKoSP3kk=; b=M2iFZFpIXCXKrum5NoOErZ5a3lUrhH5w1gEpIfbFuTGiph0rTMg0g4ge3jxynEw48+AkoiVk5OZp/EAcDcH0EDnO+p4fsRDG6St8o9Lxf9FqbIthbyD6W5T85gBEKXfH7ZukxSYcU6Jyco7tRbEgDBFHZMUz0TS2/ieo4fnsuFw= 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 1570709462283841.7462593155163; Thu, 10 Oct 2019 05:11:02 -0700 (PDT) Received: from localhost ([::1]:36964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXHY-0003Oe-IE for importer@patchew.org; Thu, 10 Oct 2019 08:11:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51966) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrD-0006jU-H1 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrB-0008GV-Cm for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41170) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWr5-0008Do-Hs; Thu, 10 Oct 2019 07:43:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A70FF3084249; Thu, 10 Oct 2019 11:43:38 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2399960920; Thu, 10 Oct 2019 11:43:37 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 16/36] iotests: 257: drop device_add Date: Thu, 10 Oct 2019 13:42:40 +0200 Message-Id: <20191010114300.7746-17-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 10 Oct 2019 11:43:38 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 SCSI devices are unused in test, drop them. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20190920142056.12778-12-vsementsov@virtuozzo.com Signed-off-by: Max Reitz --- tests/qemu-iotests/257 | 8 ------- tests/qemu-iotests/257.out | 44 -------------------------------------- 2 files changed, 52 deletions(-) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index 5d77202157..de8b45f094 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -325,12 +325,6 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap'= , failure=3DNone): node_name=3Ddrive0.node, driver=3Ddrive0.fmt, file=3Dfile_config) - # Use share-rw to allow writes directly to the node; - # The anonymous block-backend for this configuration prevents us - # from using HMP's qemu-io commands to address the device. - vm.qmp_log("device_add", id=3D'device0', - drive=3Ddrive0.node, driver=3D"scsi-hd", - share_rw=3DTrue) log('') =20 # 0 - Writes and Reference Backup @@ -467,8 +461,6 @@ def test_backup_api(): node_name=3Ddrive0.node, driver=3Ddrive0.fmt, file=3Dfile_config) - vm.qmp_log("device_add", id=3D'device0', - drive=3Ddrive0.node, driver=3D"scsi-hd") log('') =20 target0 =3D Drive(backup_path, vm=3Dvm) diff --git a/tests/qemu-iotests/257.out b/tests/qemu-iotests/257.out index c9b4b68232..ec7e25877b 100644 --- a/tests/qemu-iotests/257.out +++ b/tests/qemu-iotests/257.out @@ -5,8 +5,6 @@ =20 {"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": {}} =20 --- Write #0 --- =20 @@ -267,8 +265,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fback= up2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -480,8 +476,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fback= up2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -742,8 +736,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fback= up2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -1004,8 +996,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbac= kup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -1217,8 +1207,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -1479,8 +1467,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -1741,8 +1727,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -1954,8 +1938,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -2216,8 +2198,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -2478,8 +2458,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -2691,8 +2669,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -2953,8 +2929,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -3215,8 +3189,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -3428,8 +3400,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -3690,8 +3660,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -3952,8 +3920,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -4165,8 +4131,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -4427,8 +4391,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -4689,8 +4651,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -4902,8 +4862,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 --- Write #0 --- =20 @@ -5164,8 +5122,6 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fba= ckup2" =3D=3D> Identical, OK! =20 {"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": {}} =20 {} {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710123; cv=none; d=zoho.com; s=zohoarc; b=ROolmBz+ecteNNSdYPztiG5yQvGe+dmHa+Ph/fcNNk5fcwsTGMv27XnHWLk71XhRA6ZFHh+nMvNgZ1zlEdZmb5QKvVsc9a0SdVZ3ddsRzkFXDks9IsAPVOCyY4mvOLUadkql/c8wrqvY89E9IC9BDokiuQhdPHStqJ2NWk5MfWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710123; 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; bh=drF4p/uXflquKaxc0P2s6ZTDki6EdiUJEjefgX8i1T8=; b=fk/QhTTu2gwApeu1doCZMhxG1cIsYIee21zDLOTUHWLB4dpgX9ZlAGkgP4991i52CBTBpFDYwWjI/twlUE7+cA08INT1QDQ5nyC5RV+RtyJhqINXnbKALdoWfmni8HwWd1tnKl2GgxEwrSXWRs5+AzJFCMcKOFg/AlHsVhkiE9c= 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 157071012320967.40404757726321; Thu, 10 Oct 2019 05:22:03 -0700 (PDT) Received: from localhost ([::1]:37124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXSA-0000AR-Ng for importer@patchew.org; Thu, 10 Oct 2019 08:21:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51937) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrB-0006gb-Q1 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrA-0008Fw-IF for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41178) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWr7-0008Eb-Hf; Thu, 10 Oct 2019 07:43:42 -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 C941D3084249; Thu, 10 Oct 2019 11:43:40 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6ED7860BF7; Thu, 10 Oct 2019 11:43:40 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 17/36] qapi: group BlockDeviceStats fields Date: Thu, 10 Oct 2019 13:42:41 +0200 Message-Id: <20191010114300.7746-18-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.40]); Thu, 10 Oct 2019 11:43:40 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Anton Nefedov Make the stat fields definition slightly more readable. Also reorder total_time_ns stats read-write-flush as done elsewhere. Cosmetic change only. Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20190923121737.83281-2-anton.nefedov@virtuozzo.com Signed-off-by: Max Reitz --- qapi/block-core.json | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index e6edd641f1..5ab554b54a 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -867,12 +867,12 @@ # @flush_operations: The number of cache flush operations performed by the # device (since 0.15.0) # -# @flush_total_time_ns: Total time spend on cache flushes in nano-seconds -# (since 0.15.0). +# @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15.= 0). # -# @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.1= 5.0). +# @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15= .0). # -# @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15= .0). +# @flush_total_time_ns: Total time spent on cache flushes in nanoseconds +# (since 0.15.0). # # @wr_highest_offset: The offset after the greatest byte written to the # device. The intended use of this information is for @@ -925,14 +925,18 @@ # Since: 0.14.0 ## { 'struct': 'BlockDeviceStats', - 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int', - 'wr_operations': 'int', 'flush_operations': 'int', - 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int', - 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int', - 'rd_merged': 'int', 'wr_merged': 'int', '*idle_time_ns': 'int', + 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', + 'rd_operations': 'int', 'wr_operations': 'int', + 'flush_operations': 'int', + 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int', + 'flush_total_time_ns': 'int', + 'wr_highest_offset': 'int', + 'rd_merged': 'int', 'wr_merged': 'int', + '*idle_time_ns': 'int', 'failed_rd_operations': 'int', 'failed_wr_operations': 'int', - 'failed_flush_operations': 'int', 'invalid_rd_operations': 'int= ', - 'invalid_wr_operations': 'int', 'invalid_flush_operations': 'in= t', + 'failed_flush_operations': 'int', + 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int', + 'invalid_flush_operations': 'int', 'account_invalid': 'bool', 'account_failed': 'bool', 'timed_stats': ['BlockDeviceTimedStats'], '*rd_latency_histogram': 'BlockLatencyHistogramInfo', --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710485; cv=none; d=zoho.com; s=zohoarc; b=ajmpSmH75tIq5vSLWYIIG6CqPQoN8sYh//GYBBdeJU69tD7TcmeY6JTlGBu2TOyEEkldM3ifx7dnfdsHhAmpeoEzFdnQgH/H6OQPga5+IvVeWLZ4Kx+wHh7hzUcJKIT/N6137gS48FRXdcyJb7gQyQNHTGH3Bo5UGW1Rbf6zbzM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710485; 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; bh=gWsi7HqvYMuB1xd+wgKq57Y6ejx0sB8Im1YuDZDCrIo=; b=OzIzNb6gXMpF64hx18cjRO6cjpcsjP8Ldl6CSv5NFUioiikwHDa0QvAhf5ZHdi7vih3Ul6AKEB3mL4eaffg9SjHdm5Tsp29Vlz+nhmEqZ9+lgd2gDqX/sCe04Qh+gxwXTbHWmgXZ+snfeXCYd9TxmnwptubdrC3C5YpJQZ9tRTY= 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 157071048588383.28404145899265; Thu, 10 Oct 2019 05:28:05 -0700 (PDT) Received: from localhost ([::1]:37204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXY4-0007bg-2T for importer@patchew.org; Thu, 10 Oct 2019 08:28:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51996) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrF-0006p5-FC for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrD-0008Hn-M7 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60526) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWr9-0008FN-SK; Thu, 10 Oct 2019 07:43:44 -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 1D8E83086218; Thu, 10 Oct 2019 11:43:43 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90E8510013A1; Thu, 10 Oct 2019 11:43:42 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 18/36] qapi: add unmap to BlockDeviceStats Date: Thu, 10 Oct 2019 13:42:42 +0200 Message-Id: <20191010114300.7746-19-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.42]); Thu, 10 Oct 2019 11:43:43 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Anton Nefedov Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Reviewed-by: Eric Blake Message-id: 20190923121737.83281-3-anton.nefedov@virtuozzo.com Signed-off-by: Max Reitz --- qapi/block-core.json | 29 +++++++++++++++++++++++------ include/block/accounting.h | 1 + block/qapi.c | 6 ++++++ tests/qemu-iotests/227.out | 18 ++++++++++++++++++ 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 5ab554b54a..7d3e05891c 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -860,6 +860,8 @@ # # @wr_bytes: The number of bytes written by the device. # +# @unmap_bytes: The number of bytes unmapped by the device (Since 4.2) +# # @rd_operations: The number of read operations performed by the device. # # @wr_operations: The number of write operations performed by the device. @@ -867,6 +869,9 @@ # @flush_operations: The number of cache flush operations performed by the # device (since 0.15.0) # +# @unmap_operations: The number of unmap operations performed by the device +# (Since 4.2) +# # @rd_total_time_ns: Total time spent on reads in nanoseconds (since 0.15.= 0). # # @wr_total_time_ns: Total time spent on writes in nanoseconds (since 0.15= .0). @@ -874,6 +879,9 @@ # @flush_total_time_ns: Total time spent on cache flushes in nanoseconds # (since 0.15.0). # +# @unmap_total_time_ns: Total time spent on unmap operations in nanoseconds +# (Since 4.2) +# # @wr_highest_offset: The offset after the greatest byte written to the # device. The intended use of this information is for # growable sparse files (like qcow2) that are used on = top @@ -885,6 +893,9 @@ # @wr_merged: Number of write requests that have been merged into another # request (Since 2.3). # +# @unmap_merged: Number of unmap requests that have been merged into anoth= er +# request (Since 4.2) +# # @idle_time_ns: Time since the last I/O operation, in # nanoseconds. If the field is absent it means that # there haven't been any operations yet (Since 2.5). @@ -898,6 +909,9 @@ # @failed_flush_operations: The number of failed flush operations # performed by the device (Since 2.5) # +# @failed_unmap_operations: The number of failed unmap operations performed +# by the device (Since 4.2) +# # @invalid_rd_operations: The number of invalid read operations # performed by the device (Since 2.5) # @@ -907,6 +921,9 @@ # @invalid_flush_operations: The number of invalid flush operations # performed by the device (Since 2.5) # +# @invalid_unmap_operations: The number of invalid unmap operations perfor= med +# by the device (Since 4.2) +# # @account_invalid: Whether invalid operations are included in the # last access statistics (Since 2.5) # @@ -925,18 +942,18 @@ # Since: 0.14.0 ## { 'struct': 'BlockDeviceStats', - 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', + 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'unmap_bytes' : 'int', 'rd_operations': 'int', 'wr_operations': 'int', - 'flush_operations': 'int', + 'flush_operations': 'int', 'unmap_operations': 'int', 'rd_total_time_ns': 'int', 'wr_total_time_ns': 'int', - 'flush_total_time_ns': 'int', + 'flush_total_time_ns': 'int', 'unmap_total_time_ns': 'int', 'wr_highest_offset': 'int', - 'rd_merged': 'int', 'wr_merged': 'int', + 'rd_merged': 'int', 'wr_merged': 'int', 'unmap_merged': 'int', '*idle_time_ns': 'int', 'failed_rd_operations': 'int', 'failed_wr_operations': 'int', - 'failed_flush_operations': 'int', + 'failed_flush_operations': 'int', 'failed_unmap_operations': 'i= nt', 'invalid_rd_operations': 'int', 'invalid_wr_operations': 'int', - 'invalid_flush_operations': 'int', + 'invalid_flush_operations': 'int', 'invalid_unmap_operations': = 'int', 'account_invalid': 'bool', 'account_failed': 'bool', 'timed_stats': ['BlockDeviceTimedStats'], '*rd_latency_histogram': 'BlockLatencyHistogramInfo', diff --git a/include/block/accounting.h b/include/block/accounting.h index d1f67b10dd..ba8b04d572 100644 --- a/include/block/accounting.h +++ b/include/block/accounting.h @@ -36,6 +36,7 @@ enum BlockAcctType { BLOCK_ACCT_READ, BLOCK_ACCT_WRITE, BLOCK_ACCT_FLUSH, + BLOCK_ACCT_UNMAP, BLOCK_MAX_IOTYPE, }; =20 diff --git a/block/qapi.c b/block/qapi.c index 7ee2ee065d..69c35c4196 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -440,24 +440,30 @@ static void bdrv_query_blk_stats(BlockDeviceStats *ds= , BlockBackend *blk) =20 ds->rd_bytes =3D stats->nr_bytes[BLOCK_ACCT_READ]; ds->wr_bytes =3D stats->nr_bytes[BLOCK_ACCT_WRITE]; + ds->unmap_bytes =3D stats->nr_bytes[BLOCK_ACCT_UNMAP]; ds->rd_operations =3D stats->nr_ops[BLOCK_ACCT_READ]; ds->wr_operations =3D stats->nr_ops[BLOCK_ACCT_WRITE]; + ds->unmap_operations =3D stats->nr_ops[BLOCK_ACCT_UNMAP]; =20 ds->failed_rd_operations =3D stats->failed_ops[BLOCK_ACCT_READ]; ds->failed_wr_operations =3D stats->failed_ops[BLOCK_ACCT_WRITE]; ds->failed_flush_operations =3D stats->failed_ops[BLOCK_ACCT_FLUSH]; + ds->failed_unmap_operations =3D stats->failed_ops[BLOCK_ACCT_UNMAP]; =20 ds->invalid_rd_operations =3D stats->invalid_ops[BLOCK_ACCT_READ]; ds->invalid_wr_operations =3D stats->invalid_ops[BLOCK_ACCT_WRITE]; ds->invalid_flush_operations =3D stats->invalid_ops[BLOCK_ACCT_FLUSH]; + ds->invalid_unmap_operations =3D stats->invalid_ops[BLOCK_ACCT_UNMAP]; =20 ds->rd_merged =3D stats->merged[BLOCK_ACCT_READ]; ds->wr_merged =3D stats->merged[BLOCK_ACCT_WRITE]; + ds->unmap_merged =3D stats->merged[BLOCK_ACCT_UNMAP]; ds->flush_operations =3D stats->nr_ops[BLOCK_ACCT_FLUSH]; ds->wr_total_time_ns =3D stats->total_time_ns[BLOCK_ACCT_WRITE]; ds->rd_total_time_ns =3D stats->total_time_ns[BLOCK_ACCT_READ]; ds->flush_total_time_ns =3D stats->total_time_ns[BLOCK_ACCT_FLUSH]; + ds->unmap_total_time_ns =3D stats->total_time_ns[BLOCK_ACCT_UNMAP]; =20 ds->has_idle_time_ns =3D stats->last_access_time_ns > 0; if (ds->has_idle_time_ns) { diff --git a/tests/qemu-iotests/227.out b/tests/qemu-iotests/227.out index 3dd3ca5708..9c09ee3917 100644 --- a/tests/qemu-iotests/227.out +++ b/tests/qemu-iotests/227.out @@ -15,6 +15,8 @@ Testing: -drive driver=3Dnull-co,read-zeroes=3Don,if=3Dvi= rtio { "device": "virtio0", "stats": { + "unmap_operations": 0, + "unmap_merged": 0, "flush_total_time_ns": 0, "wr_highest_offset": 0, "wr_total_time_ns": 0, @@ -24,13 +26,17 @@ Testing: -drive driver=3Dnull-co,read-zeroes=3Don,if=3D= virtio "wr_bytes": 0, "timed_stats": [ ], + "failed_unmap_operations": 0, "failed_flush_operations": 0, "account_invalid": true, "rd_total_time_ns": 0, + "invalid_unmap_operations": 0, "flush_operations": 0, "wr_operations": 0, + "unmap_bytes": 0, "rd_merged": 0, "rd_bytes": 0, + "unmap_total_time_ns": 0, "invalid_flush_operations": 0, "account_failed": true, "rd_operations": 0, @@ -74,6 +80,8 @@ Testing: -drive driver=3Dnull-co,if=3Dnone { "device": "none0", "stats": { + "unmap_operations": 0, + "unmap_merged": 0, "flush_total_time_ns": 0, "wr_highest_offset": 0, "wr_total_time_ns": 0, @@ -83,13 +91,17 @@ Testing: -drive driver=3Dnull-co,if=3Dnone "wr_bytes": 0, "timed_stats": [ ], + "failed_unmap_operations": 0, "failed_flush_operations": 0, "account_invalid": true, "rd_total_time_ns": 0, + "invalid_unmap_operations": 0, "flush_operations": 0, "wr_operations": 0, + "unmap_bytes": 0, "rd_merged": 0, "rd_bytes": 0, + "unmap_total_time_ns": 0, "invalid_flush_operations": 0, "account_failed": true, "rd_operations": 0, @@ -163,6 +175,8 @@ Testing: -blockdev driver=3Dnull-co,read-zeroes=3Don,no= de-name=3Dnull -device virtio-b { "device": "", "stats": { + "unmap_operations": 0, + "unmap_merged": 0, "flush_total_time_ns": 0, "wr_highest_offset": 0, "wr_total_time_ns": 0, @@ -172,13 +186,17 @@ Testing: -blockdev driver=3Dnull-co,read-zeroes=3Don,= node-name=3Dnull -device virtio-b "wr_bytes": 0, "timed_stats": [ ], + "failed_unmap_operations": 0, "failed_flush_operations": 0, "account_invalid": false, "rd_total_time_ns": 0, + "invalid_unmap_operations": 0, "flush_operations": 0, "wr_operations": 0, + "unmap_bytes": 0, "rd_merged": 0, "rd_bytes": 0, + "unmap_total_time_ns": 0, "invalid_flush_operations": 0, "account_failed": false, "rd_operations": 0, --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710309; cv=none; d=zoho.com; s=zohoarc; b=QKy6uv9Q6njwPeWASD51SDb/JOLlFiOTFo+FXLh6G7PyGGgL/O42ABkO7NKUENQYo602U3O4ooPxWQO8WHzbWS+VDtpp2KmAnAVRNmeyRGCUwei+KVzyS4XsIPTgaC0QaUsaLbByqBTigL2UD8SdVbJ1qRs2AkuoxY6LSdi8frg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710309; 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; bh=GkH6ErTklJbqcFNvwQTZ6lADPmuIj21rUexgyxZTD8g=; b=RFCldKhoiDBm/xZ/J8N/QvguxQkAB8oCZu5+rhPc0TSAVJ3B7KNZ6n9jMkBe4WuZwVz20egJTvrZvB66ZZq2GpGZQMpCoALL84U3J5EnOkOwQIy4z06z0slfRjQrf7X1VzAaq6pOrqvjJEuI4j8KwKrd2UypnMoKwbRCSbMz5GI= 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 1570710309036701.777473039953; Thu, 10 Oct 2019 05:25:09 -0700 (PDT) Received: from localhost ([::1]:37166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXVD-0003zC-64 for importer@patchew.org; Thu, 10 Oct 2019 08:25:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51998) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrF-0006pW-I6 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrE-0008IC-CZ for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20545) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrB-0008GR-UA; Thu, 10 Oct 2019 07:43: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 2A85A20E9; Thu, 10 Oct 2019 11:43:45 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4D9C5DA2C; Thu, 10 Oct 2019 11:43:44 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 19/36] block: add empty account cookie type Date: Thu, 10 Oct 2019 13:42:43 +0200 Message-Id: <20191010114300.7746-20-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.6.2 (mx1.redhat.com [10.5.110.71]); Thu, 10 Oct 2019 11:43:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Anton Nefedov Each block_acct_done/failed call is designed to correspond to a previous block_acct_start call, which initializes the stats cookie. However sometimes it is not the case, e.g. some error paths might report the same cookie twice because it is hard to accurately track if the cookie was reported yet or not. This patch cleans the cookie after report. (Note: block_acct_failed/done without a previous block_acct_start at all should be avoided. Uninitialized cookie might hold a garbage value and there is still "< BLOCK_MAX_IOTYPE" assertion for that) It will be particularly useful in ide code where it's hard to keep track whether the request done its accounting or not: in the following patch of the series, trim requests will do the accounting separately. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20190923121737.83281-4-anton.nefedov@virtuozzo.com Signed-off-by: Max Reitz --- include/block/accounting.h | 1 + block/accounting.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/block/accounting.h b/include/block/accounting.h index ba8b04d572..878b4c3581 100644 --- a/include/block/accounting.h +++ b/include/block/accounting.h @@ -33,6 +33,7 @@ typedef struct BlockAcctTimedStats BlockAcctTimedStats; typedef struct BlockAcctStats BlockAcctStats; =20 enum BlockAcctType { + BLOCK_ACCT_NONE =3D 0, BLOCK_ACCT_READ, BLOCK_ACCT_WRITE, BLOCK_ACCT_FLUSH, diff --git a/block/accounting.c b/block/accounting.c index 70a3d9a426..8d41c8a83a 100644 --- a/block/accounting.c +++ b/block/accounting.c @@ -195,6 +195,10 @@ static void block_account_one_io(BlockAcctStats *stats= , BlockAcctCookie *cookie, =20 assert(cookie->type < BLOCK_MAX_IOTYPE); =20 + if (cookie->type =3D=3D BLOCK_ACCT_NONE) { + return; + } + qemu_mutex_lock(&stats->lock); =20 if (failed) { @@ -217,6 +221,8 @@ static void block_account_one_io(BlockAcctStats *stats,= BlockAcctCookie *cookie, } =20 qemu_mutex_unlock(&stats->lock); + + cookie->type =3D BLOCK_ACCT_NONE; } =20 void block_acct_done(BlockAcctStats *stats, BlockAcctCookie *cookie) --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710187; cv=none; d=zoho.com; s=zohoarc; b=gb7rPbvSfgkVfHASwvOwJrbfWhDDVzG/65P6xeEQRzEnFALv2XrmsPezQ6fXZZcOFyguu+wnX9v2Sikg4j4cHfsKSewiSjYYNo1iPFk9EFwPFGWpdwJFtuXIsCYVlVLPYZ2UDL/Awq0fxV30kujBlf9xM9cDVBRaOsP+MJs+W1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710187; 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; bh=eR3hu9ENTXFSSaDB42fKbhTTqS316c8wKBdHAZ6ETVQ=; b=W5H5K+EJV+qYdp5mZYiHnlrAIQplESc5zyuZEQ9UAMvqW8YAApbmxsbWBmokE4ngS6TyOoOHGQIxRLCTymYraXkwKtQVgq2m46AQVj03gKs68WbVm0S7MVSn3AnK8JHDpj5M9Wn5xVpIIdusJyGOighJ6c72z1orN+AUN8BzK+k= 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 15707101877401010.0518195575678; Thu, 10 Oct 2019 05:23:07 -0700 (PDT) Received: from localhost ([::1]:37134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXTG-0001ke-3A for importer@patchew.org; Thu, 10 Oct 2019 08:23:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52031) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrH-0006sk-EG for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrG-0008J4-Bx for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37998) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrD-0008HR-Vn; Thu, 10 Oct 2019 07:43:48 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3599918C4262; Thu, 10 Oct 2019 11:43:47 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB89460A9F; Thu, 10 Oct 2019 11:43:46 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 20/36] ide: account UNMAP (TRIM) operations Date: Thu, 10 Oct 2019 13:42:44 +0200 Message-Id: <20191010114300.7746-21-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Thu, 10 Oct 2019 11:43:47 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Anton Nefedov Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20190923121737.83281-5-anton.nefedov@virtuozzo.com Signed-off-by: Max Reitz --- hw/ide/core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/ide/core.c b/hw/ide/core.c index e6e54c6c9a..754ff4dc34 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -442,6 +442,14 @@ static void ide_issue_trim_cb(void *opaque, int ret) TrimAIOCB *iocb =3D opaque; IDEState *s =3D iocb->s; =20 + if (iocb->i >=3D 0) { + if (ret >=3D 0) { + block_acct_done(blk_get_stats(s->blk), &s->acct); + } else { + block_acct_failed(blk_get_stats(s->blk), &s->acct); + } + } + if (ret >=3D 0) { while (iocb->j < iocb->qiov->niov) { int j =3D iocb->j; @@ -459,10 +467,14 @@ static void ide_issue_trim_cb(void *opaque, int ret) } =20 if (!ide_sect_range_ok(s, sector, count)) { + block_acct_invalid(blk_get_stats(s->blk), BLOCK_ACCT_U= NMAP); iocb->ret =3D -EINVAL; goto done; } =20 + block_acct_start(blk_get_stats(s->blk), &s->acct, + count << BDRV_SECTOR_BITS, BLOCK_ACCT_UNM= AP); + /* Got an entry! Submit and exit. */ iocb->aiocb =3D blk_aio_pdiscard(s->blk, sector << BDRV_SECTOR_BITS, --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710381; cv=none; d=zoho.com; s=zohoarc; b=nrkgT0IrcDsnJV84DVLlIFlbkPe+nOz54N6D+TNVORBFfGhsbUrBn0XCb+n9f/+HHELLmBMbfVXaHUJt5xK/wdYdM6suteABBwym9OFZFTUjJ4SuhVuMgCc2YyUjNWV98ZyO/ERlPHqYTWCTWRhJYXOsY9Wq8aOyxSay2YxtFnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710381; 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; bh=zy+Z6YP7l6C45jlOyXc7Ie71H7AlI+88CmvQ9RfxmEQ=; b=CIcXh/XKj0TML8HFWEzjQxMLk8c8Y1x/TYKBmf6n4232SsJGMs+yi1AvyXgGWmpSkEkpwusqmPCTXJcDwV5Wx3GEh1gvNSx8j3+AgULc/1RkOR/xTqrASu0hlP7E71C79JvJNjHRzWdSHP3xhAQYbJlHFBfw/iMp21cUd3UNWaw= 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 1570710381924992.5098016910218; Thu, 10 Oct 2019 05:26:21 -0700 (PDT) Received: from localhost ([::1]:37178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXWM-0005HI-E4 for importer@patchew.org; Thu, 10 Oct 2019 08:26:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52053) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrJ-0006wX-Gd for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrI-0008Jc-9N for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55984) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrF-0008IZ-Ux; Thu, 10 Oct 2019 07:43:50 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 386D087638; Thu, 10 Oct 2019 11:43:49 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2A77600C4; Thu, 10 Oct 2019 11:43:48 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 21/36] scsi: store unmap offset and nb_sectors in request struct Date: Thu, 10 Oct 2019 13:42:45 +0200 Message-Id: <20191010114300.7746-22-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 10 Oct 2019 11:43:49 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Anton Nefedov it allows to report it in the error handler Signed-off-by: Anton Nefedov Message-id: 20190923121737.83281-6-anton.nefedov@virtuozzo.com Signed-off-by: Max Reitz --- hw/scsi/scsi-disk.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 915641a0f1..b3dd21800d 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1608,8 +1608,6 @@ static void scsi_unmap_complete_noio(UnmapCBData *dat= a, int ret) { SCSIDiskReq *r =3D data->r; SCSIDiskState *s =3D DO_UPCAST(SCSIDiskState, qdev, r->req.dev); - uint64_t sector_num; - uint32_t nb_sectors; =20 assert(r->req.aiocb =3D=3D NULL); if (scsi_disk_req_check_error(r, ret, false)) { @@ -1617,16 +1615,18 @@ static void scsi_unmap_complete_noio(UnmapCBData *d= ata, int ret) } =20 if (data->count > 0) { - sector_num =3D ldq_be_p(&data->inbuf[0]); - nb_sectors =3D ldl_be_p(&data->inbuf[8]) & 0xffffffffULL; - if (!check_lba_range(s, sector_num, nb_sectors)) { + r->sector =3D ldq_be_p(&data->inbuf[0]) + * (s->qdev.blocksize / BDRV_SECTOR_SIZE); + r->sector_count =3D (ldl_be_p(&data->inbuf[8]) & 0xffffffffULL) + * (s->qdev.blocksize / BDRV_SECTOR_SIZE); + if (!check_lba_range(s, r->sector, r->sector_count)) { scsi_check_condition(r, SENSE_CODE(LBA_OUT_OF_RANGE)); goto done; } =20 r->req.aiocb =3D blk_aio_pdiscard(s->qdev.conf.blk, - sector_num * s->qdev.blocksize, - nb_sectors * s->qdev.blocksize, + r->sector * BDRV_SECTOR_SIZE, + r->sector_count * BDRV_SECTOR_SIZE, scsi_unmap_complete, data); data->count--; data->inbuf +=3D 16; --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710397; cv=none; d=zoho.com; s=zohoarc; b=LwWvVxo62l0yBOTFPaKPr2yNsriQaS8iCmU4ky3bsYZNb2WabUvrZ3X4CYcNaCpQcKwXjCpBOftVOHdbhFJgWSqBw/94tTjOZHd5XhZMERnM9bGB7/aDT9x47g/ULqB1Q5ua1ME6MVSOI6UAAPCucUZoASRFqTv4T089HrXj8D8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710397; 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; bh=8IsWWpufp+6TpFF4mbYDY+iVbrc3/I25tcr7RLQT1n8=; b=N1+aUd0O+3PyTtrQpM7P4de1pdH2Ld27nHxp8LwWHyxNoRd2T23p+ZO6y7g01UP/HMVbJIoP9D3WEZmbhd/dwnmQqlGRN/hB378DWaDEYlIoQNp0i7puyePiziEhcyDsZXaCGpmLwNM0FOmTpcdM/inMx/wlYgklsXyStMo+zJY= 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 1570710397465177.84166331510983; Thu, 10 Oct 2019 05:26:37 -0700 (PDT) Received: from localhost ([::1]:37180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXWd-0005lK-TV for importer@patchew.org; Thu, 10 Oct 2019 08:26:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52080) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrL-000709-Lg for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrK-0008KL-Gr for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55990) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrI-0008JV-5d; Thu, 10 Oct 2019 07:43:52 -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 67F4E87638; Thu, 10 Oct 2019 11:43:51 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E4C460BE1; Thu, 10 Oct 2019 11:43:50 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 22/36] scsi: move unmap error checking to the complete callback Date: Thu, 10 Oct 2019 13:42:46 +0200 Message-Id: <20191010114300.7746-23-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.26]); Thu, 10 Oct 2019 11:43:51 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Anton Nefedov This will help to account the operation in the following commit. The difference is that we don't call scsi_disk_req_check_error() before the 1st discard iteration anymore. That function also checks if the request is cancelled, however it shouldn't get canceled until it yields in blk_aio() functions anyway. Same approach is already used for emulate_write_same. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Message-id: 20190923121737.83281-7-anton.nefedov@virtuozzo.com Signed-off-by: Max Reitz --- hw/scsi/scsi-disk.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index b3dd21800d..a002fdabe8 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1610,9 +1610,6 @@ static void scsi_unmap_complete_noio(UnmapCBData *dat= a, int ret) SCSIDiskState *s =3D DO_UPCAST(SCSIDiskState, qdev, r->req.dev); =20 assert(r->req.aiocb =3D=3D NULL); - if (scsi_disk_req_check_error(r, ret, false)) { - goto done; - } =20 if (data->count > 0) { r->sector =3D ldq_be_p(&data->inbuf[0]) @@ -1650,7 +1647,12 @@ static void scsi_unmap_complete(void *opaque, int re= t) r->req.aiocb =3D NULL; =20 aio_context_acquire(blk_get_aio_context(s->qdev.conf.blk)); - scsi_unmap_complete_noio(data, ret); + if (scsi_disk_req_check_error(r, ret, false)) { + scsi_req_unref(&r->req); + g_free(data); + } else { + scsi_unmap_complete_noio(data, ret); + } aio_context_release(blk_get_aio_context(s->qdev.conf.blk)); } =20 --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710565; cv=none; d=zoho.com; s=zohoarc; b=C69jAGmp5UV3Q9yr6tb9fO+ffSEtHAWyxu8j71ORtKJiRO3tVkmvLc6/jthA2aTF4gmmickRxOW/ILPugPO3Wq+JHBLSIzG3dIopGgFBmtdJus5X99ZyXNhsMoki/+vEux01KcIANVk8pOxGhw5F+I+C1Urb28vH/WJsroCYFlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710565; 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; bh=oFshqNZrhAl6tvogzp0Fz66bSu39x3EtlZBMJx63wyU=; b=gXLQM1JWeNqwQ54bRg44JuSA/XfptSoAgj4/uDa2iXXCTK+j9oOiS5m8Pt3NqTiF1gxfjZ/0oX+vuMHKnk5rKwhXVI0/6dBsN00F5663kUsj+Nczga3dC0yVuIU8p1xyVTlamL6Kv1vSRCBmKv/yghX7wdezrkjWCtfO4oz8DQQ= 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 1570710565856136.61701662370604; Thu, 10 Oct 2019 05:29:25 -0700 (PDT) Received: from localhost ([::1]:37278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXZH-0000dj-NW for importer@patchew.org; Thu, 10 Oct 2019 08:29:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52103) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrN-00073n-OA for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrM-0008Kw-K2 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55802) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrK-0008K2-76; Thu, 10 Oct 2019 07:43:54 -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 724171017C03; Thu, 10 Oct 2019 11:43:53 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 16B7A5C231; Thu, 10 Oct 2019 11:43:52 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 23/36] scsi: account unmap operations Date: Thu, 10 Oct 2019 13:42:47 +0200 Message-Id: <20191010114300.7746-24-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.6.2 (mx1.redhat.com [10.5.110.64]); Thu, 10 Oct 2019 11:43:53 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Anton Nefedov Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20190923121737.83281-8-anton.nefedov@virtuozzo.com Signed-off-by: Max Reitz --- hw/scsi/scsi-disk.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index a002fdabe8..68b1675fd9 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1617,10 +1617,16 @@ static void scsi_unmap_complete_noio(UnmapCBData *d= ata, int ret) r->sector_count =3D (ldl_be_p(&data->inbuf[8]) & 0xffffffffULL) * (s->qdev.blocksize / BDRV_SECTOR_SIZE); if (!check_lba_range(s, r->sector, r->sector_count)) { + block_acct_invalid(blk_get_stats(s->qdev.conf.blk), + BLOCK_ACCT_UNMAP); scsi_check_condition(r, SENSE_CODE(LBA_OUT_OF_RANGE)); goto done; } =20 + block_acct_start(blk_get_stats(s->qdev.conf.blk), &r->acct, + r->sector_count * BDRV_SECTOR_SIZE, + BLOCK_ACCT_UNMAP); + r->req.aiocb =3D blk_aio_pdiscard(s->qdev.conf.blk, r->sector * BDRV_SECTOR_SIZE, r->sector_count * BDRV_SECTOR_SIZE, @@ -1647,10 +1653,11 @@ static void scsi_unmap_complete(void *opaque, int r= et) r->req.aiocb =3D NULL; =20 aio_context_acquire(blk_get_aio_context(s->qdev.conf.blk)); - if (scsi_disk_req_check_error(r, ret, false)) { + if (scsi_disk_req_check_error(r, ret, true)) { scsi_req_unref(&r->req); g_free(data); } else { + block_acct_done(blk_get_stats(s->qdev.conf.blk), &r->acct); scsi_unmap_complete_noio(data, ret); } aio_context_release(blk_get_aio_context(s->qdev.conf.blk)); @@ -1682,6 +1689,7 @@ static void scsi_disk_emulate_unmap(SCSIDiskReq *r, u= int8_t *inbuf) } =20 if (blk_is_read_only(s->qdev.conf.blk)) { + block_acct_invalid(blk_get_stats(s->qdev.conf.blk), BLOCK_ACCT_UNM= AP); scsi_check_condition(r, SENSE_CODE(WRITE_PROTECTED)); return; } @@ -1697,10 +1705,12 @@ static void scsi_disk_emulate_unmap(SCSIDiskReq *r,= uint8_t *inbuf) return; =20 invalid_param_len: + block_acct_invalid(blk_get_stats(s->qdev.conf.blk), BLOCK_ACCT_UNMAP); scsi_check_condition(r, SENSE_CODE(INVALID_PARAM_LEN)); return; =20 invalid_field: + block_acct_invalid(blk_get_stats(s->qdev.conf.blk), BLOCK_ACCT_UNMAP); scsi_check_condition(r, SENSE_CODE(INVALID_FIELD)); } =20 --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570709667; cv=none; d=zoho.com; s=zohoarc; b=EwEkF5QtriLl9MKbEC8Gul2CQZDd8+zxu2BLqNDvQ+UDOYFdx2nRZiPuzEoicyRHP4Fhf9M1AS7Tmw0gQ+arLV5tpOD21Z06jYOakkiBFCNMGQmbbfBXdwOEvJrqR8FbZ6EYjkZ9wVjoYW6B/mCc2fdznrgWnz2M8isT81mmWxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570709667; 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; bh=PSxBm+sVJOMNRT1zll4YKxJFDq4Jh6zY3U9pnpN+5HA=; b=LQVzpaOvNBw+3oDhy133NyfLcfCHHJ7Ljorqx3NWvLlGHWGDitytTriKE2nlssqZUuIghIFfmnrpctkB9Uzfl4zTArQRkaffEP5Td+O7j8tpnOCxXFJ+UmPoTJ/KWqJwD7+3WFvRJUV+qafCETFRxFAcGvjkwQRdrnn3I5rtztE= 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 1570709667095257.7628996502551; Thu, 10 Oct 2019 05:14:27 -0700 (PDT) Received: from localhost ([::1]:36998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXKs-00078H-1B for importer@patchew.org; Thu, 10 Oct 2019 08:14:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52121) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrP-00077e-TN for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrO-0008LY-Nc for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:43:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40416) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrM-0008Kd-88; Thu, 10 Oct 2019 07:43:56 -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 7930A18CB8E5; Thu, 10 Oct 2019 11:43:55 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1DBEC5D6A5; Thu, 10 Oct 2019 11:43:54 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 24/36] file-posix: account discard operations Date: Thu, 10 Oct 2019 13:42:48 +0200 Message-Id: <20191010114300.7746-25-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.6.2 (mx1.redhat.com [10.5.110.63]); Thu, 10 Oct 2019 11:43:55 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Anton Nefedov This will help to identify how many of the user-issued discard operations (accounted on a device level) have actually suceeded down on the host file (even though the numbers will not be exactly the same if non-raw format driver is used (e.g. qcow2 sending metadata discards)). Note that these numbers will not include discards triggered by write-zeroes + MAY_UNMAP calls. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20190923121737.83281-9-anton.nefedov@virtuozzo.com Signed-off-by: Max Reitz --- block/file-posix.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index f12c06de2d..f3934c4e10 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -161,6 +161,11 @@ typedef struct BDRVRawState { bool needs_alignment; bool drop_cache; bool check_cache_dropped; + struct { + uint64_t discard_nb_ok; + uint64_t discard_nb_failed; + uint64_t discard_bytes_ok; + } stats; =20 PRManager *pr_mgr; } BDRVRawState; @@ -2660,11 +2665,22 @@ static void coroutine_fn raw_co_invalidate_cache(Bl= ockDriverState *bs, #endif /* !__linux__ */ } =20 +static void raw_account_discard(BDRVRawState *s, uint64_t nbytes, int ret) +{ + if (ret) { + s->stats.discard_nb_failed++; + } else { + s->stats.discard_nb_ok++; + s->stats.discard_bytes_ok +=3D nbytes; + } +} + static coroutine_fn int raw_do_pdiscard(BlockDriverState *bs, int64_t offset, int bytes, bool blkd= ev) { BDRVRawState *s =3D bs->opaque; RawPosixAIOData acb; + int ret; =20 acb =3D (RawPosixAIOData) { .bs =3D bs, @@ -2678,7 +2694,9 @@ raw_do_pdiscard(BlockDriverState *bs, int64_t offset,= int bytes, bool blkdev) acb.aio_type |=3D QEMU_AIO_BLKDEV; } =20 - return raw_thread_pool_submit(bs, handle_aiocb_discard, &acb); + ret =3D raw_thread_pool_submit(bs, handle_aiocb_discard, &acb); + raw_account_discard(s, bytes, ret); + return ret; } =20 static coroutine_fn int @@ -3301,10 +3319,12 @@ static int fd_open(BlockDriverState *bs) static coroutine_fn int hdev_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes) { + BDRVRawState *s =3D bs->opaque; int ret; =20 ret =3D fd_open(bs); if (ret < 0) { + raw_account_discard(s, bytes, ret); return ret; } return raw_do_pdiscard(bs, offset, bytes, true); --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710700; cv=none; d=zoho.com; s=zohoarc; b=MYAgD+/2f6MnBSFc5WydcQ8NrDycbrLczuEqc+daR3xoyO/ubQdFDoxkYpEIhk+fVSbLORPFZHywXoE/51PbynqnvU5o+Je1YgPWeXMzxn8ljxMkpWRIYdUKXupfN6GKXHjcF18oyQvIsO1dRchsULj7CdEB1Ftrai80EI6E1cw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710700; 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; bh=A7z6YDojXGASJATvUKTTgGJEffVni4CDbX7qQqVDnfQ=; b=GdPCcA5Yc3cD9Ml1AttxVzPcmh5la1tUMaDIkmAMiW2CPgZ8bcrQDw/iHBv0el/0d9scVlu6AFhbizuVXScCAPAiawXHf7S/CQANK/KfNX+w7EsWjJl0NVdHL+SN2geJBVa/j6igEQoDQQBcREcg0/LUe235d0B57+VLjR71MBI= 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 157071070020870.95017360666247; Thu, 10 Oct 2019 05:31:40 -0700 (PDT) Received: from localhost ([::1]:37314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXbQ-0003FT-Li for importer@patchew.org; Thu, 10 Oct 2019 08:31:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52152) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrT-0007BZ-EV for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrS-0008Md-46 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51314) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrO-0008LP-JR; Thu, 10 Oct 2019 07:43:58 -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 CBA3310CC1EC; Thu, 10 Oct 2019 11:43:57 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 46A575DAAC; Thu, 10 Oct 2019 11:43:57 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 25/36] qapi: query-blockstat: add driver specific file-posix stats Date: Thu, 10 Oct 2019 13:42:49 +0200 Message-Id: <20191010114300.7746-26-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.6.2 (mx1.redhat.com [10.5.110.65]); Thu, 10 Oct 2019 11:43:57 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Anton Nefedov A block driver can provide a callback to report driver-specific statistics. file-posix driver now reports discard statistics Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster Message-id: 20190923121737.83281-10-anton.nefedov@virtuozzo.com Signed-off-by: Max Reitz --- qapi/block-core.json | 38 ++++++++++++++++++++++++++++++++++++++ include/block/block.h | 1 + include/block/block_int.h | 1 + block.c | 9 +++++++++ block/file-posix.c | 32 ++++++++++++++++++++++++++++++++ block/qapi.c | 5 +++++ 6 files changed, 86 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index 7d3e05891c..859acea014 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -960,6 +960,41 @@ '*wr_latency_histogram': 'BlockLatencyHistogramInfo', '*flush_latency_histogram': 'BlockLatencyHistogramInfo' } } =20 +## +# @BlockStatsSpecificFile: +# +# File driver statistics +# +# @discard-nb-ok: The number of successful discard operations performed by +# the driver. +# +# @discard-nb-failed: The number of failed discard operations performed by +# the driver. +# +# @discard-bytes-ok: The number of bytes discarded by the driver. +# +# Since: 4.2 +## +{ 'struct': 'BlockStatsSpecificFile', + 'data': { + 'discard-nb-ok': 'uint64', + 'discard-nb-failed': 'uint64', + 'discard-bytes-ok': 'uint64' } } + +## +# @BlockStatsSpecific: +# +# Block driver specific statistics +# +# Since: 4.2 +## +{ 'union': 'BlockStatsSpecific', + 'base': { 'driver': 'BlockdevDriver' }, + 'discriminator': 'driver', + 'data': { + 'file': 'BlockStatsSpecificFile', + 'host_device': 'BlockStatsSpecificFile' } } + ## # @BlockStats: # @@ -975,6 +1010,8 @@ # # @stats: A @BlockDeviceStats for the device. # +# @driver-specific: Optional driver-specific stats. (Since 4.2) +# # @parent: This describes the file block device if it has one. # Contains recursively the statistics of the underlying # protocol (e.g. the host file for a qcow2 image). If there is @@ -988,6 +1025,7 @@ { 'struct': 'BlockStats', 'data': {'*device': 'str', '*qdev': 'str', '*node-name': 'str', 'stats': 'BlockDeviceStats', + '*driver-specific': 'BlockStatsSpecific', '*parent': 'BlockStats', '*backing': 'BlockStats'} } =20 diff --git a/include/block/block.h b/include/block/block.h index 37c9de7446..792bb826db 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -501,6 +501,7 @@ int bdrv_get_flags(BlockDriverState *bs); int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi); ImageInfoSpecific *bdrv_get_specific_info(BlockDriverState *bs, Error **errp); +BlockStatsSpecific *bdrv_get_specific_stats(BlockDriverState *bs); void bdrv_round_to_clusters(BlockDriverState *bs, int64_t offset, int64_t bytes, int64_t *cluster_offset, diff --git a/include/block/block_int.h b/include/block/block_int.h index 0422acdf1c..2b113eb3c7 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -366,6 +366,7 @@ struct BlockDriver { int (*bdrv_get_info)(BlockDriverState *bs, BlockDriverInfo *bdi); ImageInfoSpecific *(*bdrv_get_specific_info)(BlockDriverState *bs, Error **errp); + BlockStatsSpecific *(*bdrv_get_specific_stats)(BlockDriverState *bs); =20 int coroutine_fn (*bdrv_save_vmstate)(BlockDriverState *bs, QEMUIOVector *qiov, diff --git a/block.c b/block.c index 1c7c199849..1946fc6f57 100644 --- a/block.c +++ b/block.c @@ -5155,6 +5155,15 @@ ImageInfoSpecific *bdrv_get_specific_info(BlockDrive= rState *bs, return NULL; } =20 +BlockStatsSpecific *bdrv_get_specific_stats(BlockDriverState *bs) +{ + BlockDriver *drv =3D bs->drv; + if (!drv || !drv->bdrv_get_specific_stats) { + return NULL; + } + return drv->bdrv_get_specific_stats(bs); +} + void bdrv_debug_event(BlockDriverState *bs, BlkdebugEvent event) { if (!bs || !bs->drv || !bs->drv->bdrv_debug_event) { diff --git a/block/file-posix.c b/block/file-posix.c index f3934c4e10..695fcf740d 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2753,6 +2753,36 @@ static int raw_get_info(BlockDriverState *bs, BlockD= riverInfo *bdi) return 0; } =20 +static BlockStatsSpecificFile get_blockstats_specific_file(BlockDriverStat= e *bs) +{ + BDRVRawState *s =3D bs->opaque; + return (BlockStatsSpecificFile) { + .discard_nb_ok =3D s->stats.discard_nb_ok, + .discard_nb_failed =3D s->stats.discard_nb_failed, + .discard_bytes_ok =3D s->stats.discard_bytes_ok, + }; +} + +static BlockStatsSpecific *raw_get_specific_stats(BlockDriverState *bs) +{ + BlockStatsSpecific *stats =3D g_new(BlockStatsSpecific, 1); + + stats->driver =3D BLOCKDEV_DRIVER_FILE; + stats->u.file =3D get_blockstats_specific_file(bs); + + return stats; +} + +static BlockStatsSpecific *hdev_get_specific_stats(BlockDriverState *bs) +{ + BlockStatsSpecific *stats =3D g_new(BlockStatsSpecific, 1); + + stats->driver =3D BLOCKDEV_DRIVER_HOST_DEVICE; + stats->u.host_device =3D get_blockstats_specific_file(bs); + + return stats; +} + static QemuOptsList raw_create_opts =3D { .name =3D "raw-create-opts", .head =3D QTAILQ_HEAD_INITIALIZER(raw_create_opts.head), @@ -2960,6 +2990,7 @@ BlockDriver bdrv_file =3D { .bdrv_get_info =3D raw_get_info, .bdrv_get_allocated_file_size =3D raw_get_allocated_file_size, + .bdrv_get_specific_stats =3D raw_get_specific_stats, .bdrv_check_perm =3D raw_check_perm, .bdrv_set_perm =3D raw_set_perm, .bdrv_abort_perm_update =3D raw_abort_perm_update, @@ -3438,6 +3469,7 @@ static BlockDriver bdrv_host_device =3D { .bdrv_get_info =3D raw_get_info, .bdrv_get_allocated_file_size =3D raw_get_allocated_file_size, + .bdrv_get_specific_stats =3D hdev_get_specific_stats, .bdrv_check_perm =3D raw_check_perm, .bdrv_set_perm =3D raw_set_perm, .bdrv_abort_perm_update =3D raw_abort_perm_update, diff --git a/block/qapi.c b/block/qapi.c index 69c35c4196..9a5d0c9b27 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -543,6 +543,11 @@ static BlockStats *bdrv_query_bds_stats(BlockDriverSta= te *bs, =20 s->stats->wr_highest_offset =3D stat64_get(&bs->wr_highest_offset); =20 + s->driver_specific =3D bdrv_get_specific_stats(bs); + if (s->driver_specific) { + s->has_driver_specific =3D true; + } + if (bs->file) { s->has_parent =3D true; s->parent =3D bdrv_query_bds_stats(bs->file->bs, blk_level); --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710871; cv=none; d=zoho.com; s=zohoarc; b=hJgR6/TFs6bu+h2PzUg1jzgUhGzDVUXL6mhOFLLfFjk1pwqEdqNFrztXo/g43fryHUnLLiVIp5bGrSHq2+a3B8e6udJpAZIjwfBCDTBiOMzK8WKzwvzbiMK3sxjM24Y52bFNnzPVaXiJwz8nntKQkt48kOdUtsu3VmYqxCKx49c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710871; 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; bh=ljApv1blFcD3RZzL3wWbBIU0w3rBijEUH2zjkjYV/Ug=; b=MudWbqpuqmolzplQYH6z7rf/TRWy8C7HUSb512FUUU072hkTqHGYH9igdomIDYTNhLvMeVvIny+IAHyMTM0wrbqWgAPm61Of7o2e414ffXb+VgWpadPaaiU7lahJc7yu0Wuw0l7QoNfVrRdqSjl5ZlI8w/OA8hiAkUG0aoGx0tE= 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 1570710871966388.5941572412347; Thu, 10 Oct 2019 05:34:31 -0700 (PDT) Received: from localhost ([::1]:37348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXeI-0006ff-GJ for importer@patchew.org; Thu, 10 Oct 2019 08:34:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52174) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrV-0007DH-Jw for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrT-0008NF-Jx for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37254) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrQ-0008Lz-Lg; Thu, 10 Oct 2019 07:44:00 -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 E5B9D883C3D; Thu, 10 Oct 2019 11:43:59 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B67260BE1; Thu, 10 Oct 2019 11:43:59 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 26/36] iotests: Fix 125 for growth_mode = metadata Date: Thu, 10 Oct 2019 13:42:50 +0200 Message-Id: <20191010114300.7746-27-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.6.2 (mx1.redhat.com [10.5.110.69]); Thu, 10 Oct 2019 11:43:59 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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" If we use growth_mode =3D metadata, it is very much possible that the file uses more disk space after we have written something to the added area. We did indeed want to test for this case, but unfortunately we evidently just copied the code from the "Test creation preallocation" section and forgot to replace "$create_mode" by "$growth_mode". We never noticed because we only read the first number from qemu-img info's "disk size" output -- and that is effectively useless, because qemu-img prints a human-readable value (which generally includes a decimal point). That will be fixed in the patch after the next one. Signed-off-by: Max Reitz Message-id: 20190925183231.11196-2-mreitz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- tests/qemu-iotests/125 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/125 b/tests/qemu-iotests/125 index dc4b8f5fb9..df328a63a6 100755 --- a/tests/qemu-iotests/125 +++ b/tests/qemu-iotests/125 @@ -111,7 +111,7 @@ for GROWTH_SIZE in 16 48 80; do if [ $file_length_2 -gt $file_length_1 ]; then echo "ERROR (grow): Image length has grown from $file_= length_1 to $file_length_2" fi - if [ $create_mode !=3D metadata ]; then + if [ $growth_mode !=3D metadata ]; then # The host size should not have grown either if [ $host_size_2 -gt $host_size_1 ]; then echo "ERROR (grow): Host size has grown from $host= _size_1 to $host_size_2" --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710791; cv=none; d=zoho.com; s=zohoarc; b=SXlHRH48jE/mHA0OP6Gv3GAGUmTriF3zm0VKOz998RMsSA5qrKOUNSnx7YVlomENzBReqEKhCcl9uSKWBrR3xnqAxkocvZe8zs9tBVhfsJ6BwwdyERaJcdYcvp/Hy+pP+KlLa+rwwVyGj2gT0kDscXrxIpGSXAz7yKe+zhVNIoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710791; 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; bh=H5fyBe3kAi0pGdwbtbSvYMbbmQiN8qMtOGc4Mxt4KLg=; b=Pkcjw3smzKEBCmvlAzgvc+x4TfAZVJmPSzzl5xEwcEQtjG3Cx/zLoI6RWTYZspytgk64Q+gR4I24ap6r7v8ykkPWeORAT9YDBiYH2a0qHQ5zZWCyQE3vwYOrIs5HP4s94i8P968FvHkcIOv8mfxKMg5ic6EGhP7SbxRBkMVqJpw= 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 157071079185463.1013636366589; Thu, 10 Oct 2019 05:33:11 -0700 (PDT) Received: from localhost ([::1]:37332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXcz-0004te-VR for importer@patchew.org; Thu, 10 Oct 2019 08:33:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52191) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWra-0007E8-Ci for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrW-0008OF-D3 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59582) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrS-0008Mi-Ol; Thu, 10 Oct 2019 07:44: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 04B44308FE8F; Thu, 10 Oct 2019 11:44:02 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9AF3510098FB; Thu, 10 Oct 2019 11:44:01 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 27/36] iotests: Disable 125 on broken XFS versions Date: Thu, 10 Oct 2019 13:42:51 +0200 Message-Id: <20191010114300.7746-28-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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]); Thu, 10 Oct 2019 11:44:02 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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" And by that I mean all XFS versions, as far as I can tell. All details are in the comment below. We never noticed this problem because we only read the first number from qemu-img info's "disk size" output -- and that is effectively useless, because qemu-img prints a human-readable value (which generally includes a decimal point). That will be fixed in the next patch. Signed-off-by: Max Reitz Message-id: 20190925183231.11196-3-mreitz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- tests/qemu-iotests/125 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/qemu-iotests/125 b/tests/qemu-iotests/125 index df328a63a6..0ef51f1e21 100755 --- a/tests/qemu-iotests/125 +++ b/tests/qemu-iotests/125 @@ -49,6 +49,46 @@ if [ -z "$TEST_IMG_FILE" ]; then TEST_IMG_FILE=3D$TEST_IMG fi =20 +# Test whether we are running on a broken XFS version. There is this +# bug: + +# $ rm -f foo +# $ touch foo +# $ block_size=3D4096 # Your FS's block size +# $ fallocate -o $((block_size / 2)) -l $block_size foo +# $ LANG=3DC xfs_bmap foo | grep hole +# 1: [8..15]: hole +# +# The problem is that the XFS driver rounds down the offset and +# rounds up the length to the block size, but independently. As +# such, it only allocates the first block in the example above, +# even though it should allocate the first two blocks (because our +# request is to fallocate something that touches both the first +# two blocks). +# +# This means that when you then write to the beginning of the +# second block, the disk usage of the first two blocks grows. +# +# That is precisely what fallocate() promises, though: That when you +# write to an area that you have fallocated, no new blocks will have +# to be allocated. + +touch "$TEST_IMG_FILE" +# Assuming there is no FS with a block size greater than 64k +fallocate -o 65535 -l 2 "$TEST_IMG_FILE" +len0=3D$(get_image_size_on_host) + +# Write to something that in theory we have just fallocated +# (Thus, the on-disk size should not increase) +poke_file "$TEST_IMG_FILE" 65536 42 +len1=3D$(get_image_size_on_host) + +if [ $len1 -gt $len0 ]; then + _notrun "the test filesystem's fallocate() is broken" +fi + +rm -f "$TEST_IMG_FILE" + # Generally, we create some image with or without existing preallocation a= nd # then resize it. Then we write some data into the image and verify that i= ts # size does not change if we have used preallocation. --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570711011; cv=none; d=zoho.com; s=zohoarc; b=hPVcfgSOYGB/n/ONbW/IMj++NQuq91Ww42Wkc45/PBychGrZvXsww0J3t+U6bZLeytpfkmwmN6nUAZBj2jvZl+QQscCaRTYNSTGN5cl4WFhxIwmOo12YTQfGx1VF/5BnlbzcjNkkdbUq8EklU0ZsDipQ+VCvMLuoT89qfZQfOmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570711011; 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; bh=X7io6m2TZ0cAIvv4SR/7iLfSaz99V9JyAqDmkT1PT48=; b=D/t8pgv902K7qujb0Yite1YAndxbFok1W97UgIt8jRy8FSAfUj24+o64YmtxVmuqHmZpkauTWAExvHuGjKkaUExARH/qOlOsIsqgMM7vLveeae1Gl/zYPYtQhcHQa7DsYADooAdfH5KVBegIpSJI/XgLsLf9rF8KZOGghLGZXmw= 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 1570711011256671.8018629505339; Thu, 10 Oct 2019 05:36:51 -0700 (PDT) Received: from localhost ([::1]:37382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXgX-0001dY-Jt for importer@patchew.org; Thu, 10 Oct 2019 08:36:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52234) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWre-0007G4-Hv for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrc-0008QH-AT for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60702) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrV-0008NX-FW; Thu, 10 Oct 2019 07:44: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 1427C81F13; Thu, 10 Oct 2019 11:44:04 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ABB0B10013A1; Thu, 10 Oct 2019 11:44:03 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 28/36] iotests: Use stat -c %b in 125 Date: Thu, 10 Oct 2019 13:42:52 +0200 Message-Id: <20191010114300.7746-29-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.25]); Thu, 10 Oct 2019 11:44:04 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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" 125 should not use qemu-img to get the on-disk image size, because that reports it in a human-readable format that is useless to us. Just use stat instead (like we do to get the image file length). Signed-off-by: Max Reitz Message-id: 20190925183231.11196-4-mreitz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- tests/qemu-iotests/125 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/qemu-iotests/125 b/tests/qemu-iotests/125 index 0ef51f1e21..4e31aa4e5f 100755 --- a/tests/qemu-iotests/125 +++ b/tests/qemu-iotests/125 @@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 get_image_size_on_host() { - $QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep "disk size" \ - | sed -e 's/^[^0-9]*\([0-9]\+\).*$/\1/' + echo $(($(stat -c '%b * %B' "$TEST_IMG_FILE"))) } =20 # get standard environment and filters --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570711238; cv=none; d=zoho.com; s=zohoarc; b=M+l1lPpkDTnHm8w73QFQeKi1vC9KeC1CLB9mIPmLBWXdTZEZMANrW+XV1K9vOBipnvKUUljbzPaIPqTr6Zq5B6xR1cwysOB/X6WeV35CSHAwI+q4yF7sWkNNYuW/NF075f89QanF2+9agiuuYYfDxVa1Y43znO6BLnSl2gJoCbE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570711238; 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; bh=DNAitkgnicIlaTlUZYR2hvzIwccRo3rGCkI4wsu5eOg=; b=RoF60b/WLXBWTw3WIbnoR7tXVs8hr0ni+JTJDtRTNaj0MK9xRR935RS3SHVOBPk0KUDBluaLbvlwuGZEZE7hpzOu3yJx2G+wcgVb9m3yaaDYJAZMp/lo0FbR78SnP8u5hswpAvLfSjHVSoJtS4rvrgK/MBAipTX96tRhgS1KVO0= 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 1570711238049337.8771293030544; Thu, 10 Oct 2019 05:40:38 -0700 (PDT) Received: from localhost ([::1]:37434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXk9-0005n6-4h for importer@patchew.org; Thu, 10 Oct 2019 08:40:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52260) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrg-0007JD-F0 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWre-0008R8-GR for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51248) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrX-0008OM-4W; Thu, 10 Oct 2019 07:44:10 -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 65A4969089; Thu, 10 Oct 2019 11:44:06 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D17875C223; Thu, 10 Oct 2019 11:44:05 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 29/36] block/backup: move in-flight requests handling from backup to block-copy Date: Thu, 10 Oct 2019 13:42:53 +0200 Message-Id: <20191010114300.7746-30-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.28]); Thu, 10 Oct 2019 11:44:06 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Move synchronization mechanism to block-copy, to be able to use one block-copy instance from backup job and backup-top filter in parallel. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20191001131409.14202-2-vsementsov@virtuozzo.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- include/block/block-copy.h | 8 ++++++ block/backup.c | 52 -------------------------------------- block/block-copy.c | 43 +++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 52 deletions(-) diff --git a/include/block/block-copy.h b/include/block/block-copy.h index 54f90d0c9a..962f91056a 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -17,6 +17,13 @@ =20 #include "block/block.h" =20 +typedef struct BlockCopyInFlightReq { + int64_t start_byte; + int64_t end_byte; + QLIST_ENTRY(BlockCopyInFlightReq) list; + CoQueue wait_queue; /* coroutines blocked on this request */ +} BlockCopyInFlightReq; + typedef void (*ProgressBytesCallbackFunc)(int64_t bytes, void *opaque); typedef void (*ProgressResetCallbackFunc)(void *opaque); typedef struct BlockCopyState { @@ -27,6 +34,7 @@ typedef struct BlockCopyState { bool use_copy_range; int64_t copy_range_size; uint64_t len; + QLIST_HEAD(, BlockCopyInFlightReq) inflight_reqs; =20 BdrvRequestFlags write_flags; =20 diff --git a/block/backup.c b/block/backup.c index 4613b8c88d..d918836f1d 100644 --- a/block/backup.c +++ b/block/backup.c @@ -29,13 +29,6 @@ =20 #define BACKUP_CLUSTER_SIZE_DEFAULT (1 << 16) =20 -typedef struct CowRequest { - int64_t start_byte; - int64_t end_byte; - QLIST_ENTRY(CowRequest) list; - CoQueue wait_queue; /* coroutines blocked on this request */ -} CowRequest; - typedef struct BackupBlockJob { BlockJob common; BlockDriverState *source_bs; @@ -51,50 +44,12 @@ typedef struct BackupBlockJob { uint64_t bytes_read; int64_t cluster_size; NotifierWithReturn before_write; - QLIST_HEAD(, CowRequest) inflight_reqs; =20 BlockCopyState *bcs; } BackupBlockJob; =20 static const BlockJobDriver backup_job_driver; =20 -/* See if in-flight requests overlap and wait for them to complete */ -static void coroutine_fn wait_for_overlapping_requests(BackupBlockJob *job, - int64_t start, - int64_t end) -{ - CowRequest *req; - bool retry; - - do { - retry =3D false; - QLIST_FOREACH(req, &job->inflight_reqs, list) { - if (end > req->start_byte && start < req->end_byte) { - qemu_co_queue_wait(&req->wait_queue, NULL); - retry =3D true; - break; - } - } - } while (retry); -} - -/* Keep track of an in-flight request */ -static void cow_request_begin(CowRequest *req, BackupBlockJob *job, - int64_t start, int64_t end) -{ - req->start_byte =3D start; - req->end_byte =3D end; - qemu_co_queue_init(&req->wait_queue); - QLIST_INSERT_HEAD(&job->inflight_reqs, req, list); -} - -/* Forget about a completed request */ -static void cow_request_end(CowRequest *req) -{ - QLIST_REMOVE(req, list); - qemu_co_queue_restart_all(&req->wait_queue); -} - static void backup_progress_bytes_callback(int64_t bytes, void *opaque) { BackupBlockJob *s =3D opaque; @@ -116,7 +71,6 @@ static int coroutine_fn backup_do_cow(BackupBlockJob *jo= b, bool *error_is_read, bool is_write_notifier) { - CowRequest cow_request; int ret =3D 0; int64_t start, end; /* bytes */ =20 @@ -127,14 +81,9 @@ static int coroutine_fn backup_do_cow(BackupBlockJob *j= ob, =20 trace_backup_do_cow_enter(job, start, offset, bytes); =20 - wait_for_overlapping_requests(job, start, end); - cow_request_begin(&cow_request, job, start, end); - ret =3D block_copy(job->bcs, start, end - start, error_is_read, is_write_notifier); =20 - cow_request_end(&cow_request); - trace_backup_do_cow_return(job, offset, bytes, ret); =20 qemu_co_rwlock_unlock(&job->flush_rwlock); @@ -316,7 +265,6 @@ static int coroutine_fn backup_run(Job *job, Error **er= rp) BackupBlockJob *s =3D container_of(job, BackupBlockJob, common.job); int ret =3D 0; =20 - QLIST_INIT(&s->inflight_reqs); qemu_co_rwlock_init(&s->flush_rwlock); =20 backup_init_copy_bitmap(s); diff --git a/block/block-copy.c b/block/block-copy.c index 3fc9152853..61e5ea5f46 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -19,6 +19,41 @@ #include "block/block-copy.h" #include "sysemu/block-backend.h" =20 +static void coroutine_fn block_copy_wait_inflight_reqs(BlockCopyState *s, + int64_t start, + int64_t end) +{ + BlockCopyInFlightReq *req; + bool waited; + + do { + waited =3D false; + QLIST_FOREACH(req, &s->inflight_reqs, list) { + if (end > req->start_byte && start < req->end_byte) { + qemu_co_queue_wait(&req->wait_queue, NULL); + waited =3D true; + break; + } + } + } while (waited); +} + +static void block_copy_inflight_req_begin(BlockCopyState *s, + BlockCopyInFlightReq *req, + int64_t start, int64_t end) +{ + req->start_byte =3D start; + req->end_byte =3D end; + qemu_co_queue_init(&req->wait_queue); + QLIST_INSERT_HEAD(&s->inflight_reqs, req, list); +} + +static void coroutine_fn block_copy_inflight_req_end(BlockCopyInFlightReq = *req) +{ + QLIST_REMOVE(req, list); + qemu_co_queue_restart_all(&req->wait_queue); +} + void block_copy_state_free(BlockCopyState *s) { if (!s) { @@ -79,6 +114,8 @@ BlockCopyState *block_copy_state_new( s->use_copy_range =3D !(write_flags & BDRV_REQ_WRITE_COMPRESSED) && s->copy_range_size >= 0; =20 + QLIST_INIT(&s->inflight_reqs); + /* * We just allow aio context change on our block backends. block_copy(= ) user * (now it's only backup) is responsible for source and target being i= n same @@ -266,6 +303,7 @@ int coroutine_fn block_copy(BlockCopyState *s, int64_t end =3D bytes + start; /* bytes */ void *bounce_buffer =3D NULL; int64_t status_bytes; + BlockCopyInFlightReq req; =20 /* * block_copy() user is responsible for keeping source and target in s= ame @@ -276,6 +314,9 @@ int coroutine_fn block_copy(BlockCopyState *s, assert(QEMU_IS_ALIGNED(start, s->cluster_size)); assert(QEMU_IS_ALIGNED(end, s->cluster_size)); =20 + block_copy_wait_inflight_reqs(s, start, bytes); + block_copy_inflight_req_begin(s, &req, start, end); + while (start < end) { int64_t dirty_end; =20 @@ -329,5 +370,7 @@ int coroutine_fn block_copy(BlockCopyState *s, qemu_vfree(bounce_buffer); } =20 + block_copy_inflight_req_end(&req); + return ret; } --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570711420; cv=none; d=zoho.com; s=zohoarc; b=N6gA/ZjXFbk+utRoLkuuPUjQWZ+DimncetJXE/AxAcsTMcROlbBFPJp2OIgU+RMpyPG1kksqE8/hVTz7gQjLGXVHmUtxbdZ8vWFhsp2gEloVdqRte7F9BXWU4BIn1cupxzHG1y3c4iAvSvq6LMHOPNv9tPXJLz9LMusuv+0mVus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570711420; 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; bh=+vjz5pYgfY/UbkLFn86qqNON8Tlk78kEObcnyM12Hwk=; b=R4MehfcH39iVO2lXfJNoGvVAHVeuDzcOQQj3fH99Pwks9bdP7bGiEWnKMrheL+Gmem1kPDFqZWz0smpc7eC7EQ08T/PTNBqsEDG0POM2X9vQEGGGRinRK2KN2a5CWybW0Uvg5lVT7PoSa7ZqfM6CCCy+dHQ2rERzTsJHo5euY9g= 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 1570711420202461.95129705024226; Thu, 10 Oct 2019 05:43:40 -0700 (PDT) Received: from localhost ([::1]:37514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXn7-0002WV-Nz for importer@patchew.org; Thu, 10 Oct 2019 08:43:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52279) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrh-0007Ku-HW for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrg-0008Ro-6M for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45786) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWra-0008Os-9v; Thu, 10 Oct 2019 07:44:12 -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 813A010CBC4B; Thu, 10 Oct 2019 11:44:08 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 244455C28C; Thu, 10 Oct 2019 11:44:07 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 30/36] block/backup: move write_flags calculation inside backup_job_create Date: Thu, 10 Oct 2019 13:42:54 +0200 Message-Id: <20191010114300.7746-31-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.6.2 (mx1.redhat.com [10.5.110.66]); Thu, 10 Oct 2019 11:44:08 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 This is logic-less refactoring, which simplifies further patch, as we'll need write_flags for backup-top filter creation and backup-top should be created before block job creation. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20191001131409.14202-3-vsementsov@virtuozzo.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- block/backup.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/block/backup.c b/block/backup.c index d918836f1d..b5b7939356 100644 --- a/block/backup.c +++ b/block/backup.c @@ -446,20 +446,6 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, goto error; } =20 - /* job->len is fixed, so we can't allow resize */ - job =3D block_job_create(job_id, &backup_job_driver, txn, bs, 0, BLK_P= ERM_ALL, - speed, creation_flags, cb, opaque, errp); - if (!job) { - goto error; - } - - job->source_bs =3D bs; - job->on_source_error =3D on_source_error; - job->on_target_error =3D on_target_error; - job->sync_mode =3D sync_mode; - job->sync_bitmap =3D sync_bitmap; - job->bitmap_mode =3D bitmap_mode; - /* * If source is in backing chain of target assume that target is going= to be * used for "image fleecing", i.e. it should represent a kind of snaps= hot of @@ -477,6 +463,20 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, write_flags =3D (bdrv_chain_contains(target, bs) ? BDRV_REQ_SERIALISIN= G : 0) | (compress ? BDRV_REQ_WRITE_COMPRESSED : 0), =20 + /* job->len is fixed, so we can't allow resize */ + job =3D block_job_create(job_id, &backup_job_driver, txn, bs, 0, BLK_P= ERM_ALL, + speed, creation_flags, cb, opaque, errp); + if (!job) { + goto error; + } + + job->source_bs =3D bs; + job->on_source_error =3D on_source_error; + job->on_target_error =3D on_target_error; + job->sync_mode =3D sync_mode; + job->sync_bitmap =3D sync_bitmap; + job->bitmap_mode =3D bitmap_mode; + job->bcs =3D block_copy_state_new(bs, target, cluster_size, write_flag= s, backup_progress_bytes_callback, backup_progress_reset_callback, job, e= rrp); @@ -485,11 +485,11 @@ BlockJob *backup_job_create(const char *job_id, Block= DriverState *bs, } =20 job->cluster_size =3D cluster_size; + job->len =3D len; =20 /* Required permissions are already taken by block-copy-state target */ block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL, &error_abort); - job->len =3D len; =20 return &job->common; =20 --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570711591; cv=none; d=zoho.com; s=zohoarc; b=orc24pBBH/11osuwqJS5w9E1MbKUwHkmU/Iv9kI5aMdb9GiLbkB9BAr+x3PgEkV2eKVxGs8LUK63NIQ6oVM8iGHe460KcJnZ/qZqxa6uZfTY9HQXRWb3UAndTwBOK97RdwYdPo+0JGa49OirSJgGKbCMc7vi9lZCOY06ehGf1eA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570711591; 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; bh=FpIwkRou9wqXzxi5bpLSN1AP/Jd6S0mJWlPDQumyGP0=; b=FnBzqiDGHnQfOF2/pPOQz36B95r/16jD323PKGqO79XHfzQu+hJvrvs5149USyC1iEhT5oDQNe2UR8zGNcMrPO5nErkaIaV0Gk3d6PAmYLk1dKf/ZeN1aaY+BTM9bAY+nXYEvTw0RdDmIz5Qp/tnMmASGAkdhvs90KyB2n0ubQU= 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 1570711591933389.43886868986044; Thu, 10 Oct 2019 05:46:31 -0700 (PDT) Received: from localhost ([::1]:37604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXps-00070h-KU for importer@patchew.org; Thu, 10 Oct 2019 08:46:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52280) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrh-0007Kv-G7 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrg-0008Rt-9o for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38208) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrc-0008Pc-8U; Thu, 10 Oct 2019 07:44:12 -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 919993090FDB; Thu, 10 Oct 2019 11:44:10 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 356CB60BE1; Thu, 10 Oct 2019 11:44:10 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 31/36] block/block-copy: split block_copy_set_callbacks function Date: Thu, 10 Oct 2019 13:42:55 +0200 Message-Id: <20191010114300.7746-32-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.43]); Thu, 10 Oct 2019 11:44:10 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Split block_copy_set_callbacks out of block_copy_state_new. It's needed for further commit: block-copy will use BdrvChildren of backup-top filter, so it will be created from backup-top filter creation function. But callbacks will still belong to backup job and will be set in separate. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20191001131409.14202-4-vsementsov@virtuozzo.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- include/block/block-copy.h | 13 +++++++++---- block/backup.c | 6 ++++-- block/block-copy.c | 24 +++++++++++++++--------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/include/block/block-copy.h b/include/block/block-copy.h index 962f91056a..340d856246 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -66,12 +66,17 @@ typedef struct BlockCopyState { void *progress_opaque; } BlockCopyState; =20 -BlockCopyState *block_copy_state_new( - BlockDriverState *source, BlockDriverState *target, - int64_t cluster_size, BdrvRequestFlags write_flags, +BlockCopyState *block_copy_state_new(BlockDriverState *source, + BlockDriverState *target, + int64_t cluster_size, + BdrvRequestFlags write_flags, + Error **errp); + +void block_copy_set_callbacks( + BlockCopyState *s, ProgressBytesCallbackFunc progress_bytes_callback, ProgressResetCallbackFunc progress_reset_callback, - void *progress_opaque, Error **errp); + void *progress_opaque); =20 void block_copy_state_free(BlockCopyState *s); =20 diff --git a/block/backup.c b/block/backup.c index b5b7939356..1057ed0a4e 100644 --- a/block/backup.c +++ b/block/backup.c @@ -478,8 +478,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, job->bitmap_mode =3D bitmap_mode; =20 job->bcs =3D block_copy_state_new(bs, target, cluster_size, write_flag= s, - backup_progress_bytes_callback, - backup_progress_reset_callback, job, e= rrp); + errp); if (!job->bcs) { goto error; } @@ -487,6 +486,9 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, job->cluster_size =3D cluster_size; job->len =3D len; =20 + block_copy_set_callbacks(job->bcs, backup_progress_bytes_callback, + backup_progress_reset_callback, job); + /* Required permissions are already taken by block-copy-state target */ block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL, &error_abort); diff --git a/block/block-copy.c b/block/block-copy.c index 61e5ea5f46..fcb112da14 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -66,12 +66,10 @@ void block_copy_state_free(BlockCopyState *s) g_free(s); } =20 -BlockCopyState *block_copy_state_new( - BlockDriverState *source, BlockDriverState *target, - int64_t cluster_size, BdrvRequestFlags write_flags, - ProgressBytesCallbackFunc progress_bytes_callback, - ProgressResetCallbackFunc progress_reset_callback, - void *progress_opaque, Error **errp) +BlockCopyState *block_copy_state_new(BlockDriverState *source, + BlockDriverState *target, + int64_t cluster_size, + BdrvRequestFlags write_flags, Error *= *errp) { BlockCopyState *s; int ret; @@ -95,9 +93,6 @@ BlockCopyState *block_copy_state_new( .cluster_size =3D cluster_size, .len =3D bdrv_dirty_bitmap_size(copy_bitmap), .write_flags =3D write_flags, - .progress_bytes_callback =3D progress_bytes_callback, - .progress_reset_callback =3D progress_reset_callback, - .progress_opaque =3D progress_opaque, }; =20 s->copy_range_size =3D QEMU_ALIGN_DOWN(MIN(blk_get_max_transfer(s->sou= rce), @@ -144,6 +139,17 @@ fail: return NULL; } =20 +void block_copy_set_callbacks( + BlockCopyState *s, + ProgressBytesCallbackFunc progress_bytes_callback, + ProgressResetCallbackFunc progress_reset_callback, + void *progress_opaque) +{ + s->progress_bytes_callback =3D progress_bytes_callback; + s->progress_reset_callback =3D progress_reset_callback; + s->progress_opaque =3D progress_opaque; +} + /* * Copy range to target with a bounce buffer and return the bytes copied. = If * error occurred, return a negative error number --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570711761; cv=none; d=zoho.com; s=zohoarc; b=LmtlaK78uzqVp2TRcYMS63Dqag3+coyys0sokZyXcBIJmVWyM0cJ/KTZ12H63hWwd1eo56PmWxNSQw2TOg1T4Nf1kltCZ+tbE4+X3o/+H/8Z4yh5ZBGO1jdabEztTr/xrECbPhJGAKXn8Y8kI/1vojpv7nxfBZMMh5DPRh1Q56Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570711761; 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; bh=Pu2S57u5tzU85zwW/CS3sxmhWxe6Iq0MAx3UJjNrjOU=; b=fR7r1OnAsxxpQeRKkHELfsJyY/9nRnpKvc1ABk56RUHEWKSM8TvRxFN9hOKqOcv+ceKSC2TdI5U/kf+p6wekiSt5UkLaqib/D+w6soTra7QpAQjoxI2FMfS5QCla7YEQT3k1YScfxnIfyAkiHe0Ls8jmgmN210/rdpTKhkTA92g= 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 1570711761104184.7167186653453; Thu, 10 Oct 2019 05:49:21 -0700 (PDT) Received: from localhost ([::1]:37800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXsd-0002eR-JF for importer@patchew.org; Thu, 10 Oct 2019 08:49:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52336) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWro-0007QL-MF for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrl-0008U0-Jv for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37304) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWre-0008Qb-Dt; Thu, 10 Oct 2019 07:44:14 -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 F328D883C44; Thu, 10 Oct 2019 11:44:12 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 46C335C231; Thu, 10 Oct 2019 11:44:12 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 32/36] block: introduce backup-top filter driver Date: Thu, 10 Oct 2019 13:42:56 +0200 Message-Id: <20191010114300.7746-33-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.6.2 (mx1.redhat.com [10.5.110.69]); Thu, 10 Oct 2019 11:44:13 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Backup-top filter caches write operations and does copy-before-write operations. The driver will be used in backup instead of write-notifiers. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20191001131409.14202-5-vsementsov@virtuozzo.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- block/Makefile.objs | 1 + block/backup-top.h | 41 +++++++ block/backup-top.c | 281 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 323 insertions(+) create mode 100644 block/backup-top.h create mode 100644 block/backup-top.c diff --git a/block/Makefile.objs b/block/Makefile.objs index f06f1fa1ac..e394fe0b6c 100644 --- a/block/Makefile.objs +++ b/block/Makefile.objs @@ -42,6 +42,7 @@ block-obj-y +=3D block-copy.o block-obj-y +=3D crypto.o =20 block-obj-y +=3D aio_task.o +block-obj-y +=3D backup-top.o =20 common-obj-y +=3D stream.o =20 diff --git a/block/backup-top.h b/block/backup-top.h new file mode 100644 index 0000000000..e5cabfa197 --- /dev/null +++ b/block/backup-top.h @@ -0,0 +1,41 @@ +/* + * backup-top filter driver + * + * The driver performs Copy-Before-Write (CBW) operation: it is injected a= bove + * some node, and before each write it copies _old_ data to the target nod= e. + * + * Copyright (c) 2018-2019 Virtuozzo International GmbH. + * + * Author: + * Sementsov-Ogievskiy Vladimir + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef BACKUP_TOP_H +#define BACKUP_TOP_H + +#include "block/block_int.h" +#include "block/block-copy.h" + +BlockDriverState *bdrv_backup_top_append(BlockDriverState *source, + BlockDriverState *target, + const char *filter_node_name, + uint64_t cluster_size, + BdrvRequestFlags write_flags, + BlockCopyState **bcs, + Error **errp); +void bdrv_backup_top_drop(BlockDriverState *bs); + +#endif /* BACKUP_TOP_H */ diff --git a/block/backup-top.c b/block/backup-top.c new file mode 100644 index 0000000000..75a315744d --- /dev/null +++ b/block/backup-top.c @@ -0,0 +1,281 @@ +/* + * backup-top filter driver + * + * The driver performs Copy-Before-Write (CBW) operation: it is injected a= bove + * some node, and before each write it copies _old_ data to the target nod= e. + * + * Copyright (c) 2018-2019 Virtuozzo International GmbH. + * + * Author: + * Sementsov-Ogievskiy Vladimir + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "qemu/osdep.h" + +#include "sysemu/block-backend.h" +#include "qemu/cutils.h" +#include "qapi/error.h" +#include "block/block_int.h" +#include "block/qdict.h" +#include "block/block-copy.h" + +#include "block/backup-top.h" + +typedef struct BDRVBackupTopState { + BlockCopyState *bcs; + BdrvChild *target; + bool active; +} BDRVBackupTopState; + +static coroutine_fn int backup_top_co_preadv( + BlockDriverState *bs, uint64_t offset, uint64_t bytes, + QEMUIOVector *qiov, int flags) +{ + return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags); +} + +static coroutine_fn int backup_top_cbw(BlockDriverState *bs, uint64_t offs= et, + uint64_t bytes) +{ + /* + * Here we'd like to use block_copy(), but block-copy need to be moved= to + * use BdrvChildren to correctly use it in backup-top filter. It's a T= ODO. + */ + + abort(); +} + +static int coroutine_fn backup_top_co_pdiscard(BlockDriverState *bs, + int64_t offset, int bytes) +{ + int ret =3D backup_top_cbw(bs, offset, bytes); + if (ret < 0) { + return ret; + } + + return bdrv_co_pdiscard(bs->backing, offset, bytes); +} + +static int coroutine_fn backup_top_co_pwrite_zeroes(BlockDriverState *bs, + int64_t offset, int bytes, BdrvRequestFlags flags) +{ + int ret =3D backup_top_cbw(bs, offset, bytes); + if (ret < 0) { + return ret; + } + + return bdrv_co_pwrite_zeroes(bs->backing, offset, bytes, flags); +} + +static coroutine_fn int backup_top_co_pwritev(BlockDriverState *bs, + uint64_t offset, + uint64_t bytes, + QEMUIOVector *qiov, int flag= s) +{ + if (!(flags & BDRV_REQ_WRITE_UNCHANGED)) { + int ret =3D backup_top_cbw(bs, offset, bytes); + if (ret < 0) { + return ret; + } + } + + return bdrv_co_pwritev(bs->backing, offset, bytes, qiov, flags); +} + +static int coroutine_fn backup_top_co_flush(BlockDriverState *bs) +{ + if (!bs->backing) { + return 0; + } + + return bdrv_co_flush(bs->backing->bs); +} + +static void backup_top_refresh_filename(BlockDriverState *bs) +{ + if (bs->backing =3D=3D NULL) { + /* + * we can be here after failed bdrv_attach_child in + * bdrv_set_backing_hd + */ + return; + } + pstrcpy(bs->exact_filename, sizeof(bs->exact_filename), + bs->backing->bs->filename); +} + +static void backup_top_child_perm(BlockDriverState *bs, BdrvChild *c, + const BdrvChildRole *role, + BlockReopenQueue *reopen_queue, + uint64_t perm, uint64_t shared, + uint64_t *nperm, uint64_t *nshared) +{ + BDRVBackupTopState *s =3D bs->opaque; + + if (!s->active) { + /* + * The filter node may be in process of bdrv_append(), which first= ly do + * bdrv_set_backing_hd() and then bdrv_replace_node(). This means = that + * we can't unshare BLK_PERM_WRITE during bdrv_append() operation.= So, + * let's require nothing during bdrv_append() and refresh permissi= ons + * after it (see bdrv_backup_top_append()). + */ + *nperm =3D 0; + *nshared =3D BLK_PERM_ALL; + return; + } + + if (role =3D=3D &child_file) { + /* + * Target child + * + * Share write to target (child_file), to not interfere + * with guest writes to its disk which may be in target backing ch= ain. + */ + *nshared =3D BLK_PERM_ALL; + *nperm =3D BLK_PERM_WRITE; + } else { + /* Source child */ + bdrv_filter_default_perms(bs, c, role, reopen_queue, perm, shared, + nperm, nshared); + + if (perm & BLK_PERM_WRITE) { + *nperm =3D *nperm | BLK_PERM_CONSISTENT_READ; + } + *nshared &=3D ~BLK_PERM_WRITE; + } +} + +BlockDriver bdrv_backup_top_filter =3D { + .format_name =3D "backup-top", + .instance_size =3D sizeof(BDRVBackupTopState), + + .bdrv_co_preadv =3D backup_top_co_preadv, + .bdrv_co_pwritev =3D backup_top_co_pwritev, + .bdrv_co_pwrite_zeroes =3D backup_top_co_pwrite_zeroes, + .bdrv_co_pdiscard =3D backup_top_co_pdiscard, + .bdrv_co_flush =3D backup_top_co_flush, + + .bdrv_co_block_status =3D bdrv_co_block_status_from_backing, + + .bdrv_refresh_filename =3D backup_top_refresh_filename, + + .bdrv_child_perm =3D backup_top_child_perm, + + .is_filter =3D true, +}; + +BlockDriverState *bdrv_backup_top_append(BlockDriverState *source, + BlockDriverState *target, + const char *filter_node_name, + uint64_t cluster_size, + BdrvRequestFlags write_flags, + BlockCopyState **bcs, + Error **errp) +{ + Error *local_err =3D NULL; + BDRVBackupTopState *state; + BlockDriverState *top =3D bdrv_new_open_driver(&bdrv_backup_top_filter, + filter_node_name, + BDRV_O_RDWR, errp); + + if (!top) { + return NULL; + } + + top->total_sectors =3D source->total_sectors; + top->opaque =3D state =3D g_new0(BDRVBackupTopState, 1); + + bdrv_ref(target); + state->target =3D bdrv_attach_child(top, target, "target", &child_file= , errp); + if (!state->target) { + bdrv_unref(target); + bdrv_unref(top); + return NULL; + } + + bdrv_drained_begin(source); + + bdrv_ref(top); + bdrv_append(top, source, &local_err); + if (local_err) { + error_prepend(&local_err, "Cannot append backup-top filter: "); + goto append_failed; + } + + /* + * bdrv_append() finished successfully, now we can require permissions + * we want. + */ + state->active =3D true; + bdrv_child_refresh_perms(top, top->backing, &local_err); + if (local_err) { + error_prepend(&local_err, + "Cannot set permissions for backup-top filter: "); + goto failed_after_append; + } + + /* + * TODO: Create block-copy-state here (which will utilize @cluster_siz= e and + * @write_flags parameters which are unused now). For this, block-copy + * should be refactored to use BdrvChildren. + */ + state->bcs =3D NULL; + if (!state->bcs) { + error_setg(&local_err, "Cannot create block-copy-state"); + goto failed_after_append; + } + *bcs =3D state->bcs; + + bdrv_drained_end(source); + + return top; + +failed_after_append: + state->active =3D false; + bdrv_backup_top_drop(top); + +append_failed: + bdrv_drained_end(source); + bdrv_unref_child(top, state->target); + bdrv_unref(top); + error_propagate(errp, local_err); + + return NULL; +} + +void bdrv_backup_top_drop(BlockDriverState *bs) +{ + BDRVBackupTopState *s =3D bs->opaque; + AioContext *aio_context =3D bdrv_get_aio_context(bs); + + block_copy_state_free(s->bcs); + + aio_context_acquire(aio_context); + + bdrv_drained_begin(bs); + + s->active =3D false; + bdrv_child_refresh_perms(bs, bs->backing, &error_abort); + bdrv_replace_node(bs, backing_bs(bs), &error_abort); + bdrv_set_backing_hd(bs, NULL, &error_abort); + + bdrv_drained_end(bs); + + bdrv_unref(bs); + + aio_context_release(aio_context); +} --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710615; cv=none; d=zoho.com; s=zohoarc; b=D17qiGdEQEELELn8hNmxRXjx8+WdiFfeE/QGuBcMwNaEjcCp5a8ZP3Nj1HkIJ3fh+XmCAXhh5VsLzr5WPPeF8Lx1g7yLa+5UcHSV3EX/Z5lER6zz5rOSOMfSGjqVZqLyutWV5/zOcY4lPUDMxoZpP4n5PRrYYaQwdIyljbmsRH0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710615; 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; bh=0hClx/IGCxVQPQlKp56Skr420LC7NKoYu/RiZP1fPh4=; b=a9FDc6Aosh7AWAErRFzP9zy+HlXYTqQKLQ1olgz3LHT3z4ZU8cdjMdiPWTnI6aM7LnVhYc0qL5KorymYXfOv0+7j70waVFQOM5jI/wj2cSSCZEmsHjKiFnji6q3jAXItz2DvTUSFEhBnke9kh680BsD5f2GnjYUy2rc7WPEO71k= 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 1570710615280784.3039501426331; Thu, 10 Oct 2019 05:30:15 -0700 (PDT) Received: from localhost ([::1]:37288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXa6-0001NA-IA for importer@patchew.org; Thu, 10 Oct 2019 08:30:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52453) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWsF-0007u7-6j for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:45:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWs5-0000BH-1r for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60626) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrh-0008Rm-KU; Thu, 10 Oct 2019 07:44:19 -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 C852130043E1; Thu, 10 Oct 2019 11:44:15 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B4B4010018F8; Thu, 10 Oct 2019 11:44:14 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 33/36] block/backup: use backup-top instead of write notifiers Date: Thu, 10 Oct 2019 13:42:57 +0200 Message-Id: <20191010114300.7746-34-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.42]); Thu, 10 Oct 2019 11:44:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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 Drop write notifiers and use filter node instead. =3D Changes =3D 1. Add filter-node-name argument for backup qmp api. We have to do it in this commit, as 257 needs to be fixed. 2. There are no more write notifiers here, so is_write_notifier parameter is dropped from block-copy paths. 3. To sync with in-flight requests at job finish we now have drained removing of the filter, we don't need rw-lock. 4. Block-copy is now using BdrvChildren instead of BlockBackends 5. As backup-top owns these children, we also move block-copy state into backup-top's ownership. =3D Iotest changes =3D 56: op-blocker doesn't shoot now, as we set it on source, but then check on filter, when trying to start second backup. To keep the test we instead can catch another collision: both jobs will get 'drive0' job-id, as job-id parameter is unspecified. To prevent interleaving with file-posix locks (as they are dependent on config) let's use another target for second backup. Also, it's obvious now that we'd like to drop this op-blocker at all and add a test-case for two backups from one node (to different destinations) actually works. But not in these series. 141: Output changed: prepatch, "Node is in use" comes from bdrv_has_blk check inside qmp_blockdev_del. But we've dropped block-copy blk objects, so no more blk objects on source bs (job blk is on backup-top filter bs). New message is from op-blocker, which is the next check in qmp_blockdev_add. 257: The test wants to emulate guest write during backup. They should go to filter node, not to original source node, of course. Therefore we need to specify filter node name and use it. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20191001131409.14202-6-vsementsov@virtuozzo.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- qapi/block-core.json | 8 +- include/block/block-copy.h | 14 +- include/block/block_int.h | 1 + block/backup-top.c | 21 +-- block/backup.c | 73 +++------ block/block-copy.c | 81 +++------- block/replication.c | 2 +- blockdev.c | 1 + tests/qemu-iotests/056 | 8 +- tests/qemu-iotests/141.out | 2 +- tests/qemu-iotests/257 | 7 +- tests/qemu-iotests/257.out | 306 ++++++++++++++++++------------------- 12 files changed, 237 insertions(+), 287 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 859acea014..f66553aac7 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1450,6 +1450,11 @@ # list without user intervention. # Defaults to true. (Since 2.12) # +# @filter-node-name: the node name that should be assigned to the +# filter driver that the backup job inserts into the gr= aph +# above node specified by @drive. If this option is not= given, +# a node name is autogenerated. (Since: 4.2) +# # Note: @on-source-error and @on-target-error only affect background # I/O. If an error occurs during a guest write request, the device's # rerror/werror actions will be used. @@ -1463,7 +1468,8 @@ '*compress': 'bool', '*on-source-error': 'BlockdevOnError', '*on-target-error': 'BlockdevOnError', - '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } } + '*auto-finalize': 'bool', '*auto-dismiss': 'bool', + '*filter-node-name': 'str' } } =20 ## # @DriveBackup: diff --git a/include/block/block-copy.h b/include/block/block-copy.h index 340d856246..e2e135ff1b 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -27,8 +27,13 @@ typedef struct BlockCopyInFlightReq { typedef void (*ProgressBytesCallbackFunc)(int64_t bytes, void *opaque); typedef void (*ProgressResetCallbackFunc)(void *opaque); typedef struct BlockCopyState { - BlockBackend *source; - BlockBackend *target; + /* + * BdrvChild objects are not owned or managed by block-copy. They are + * provided by block-copy user and user is responsible for appropriate + * permissions on these children. + */ + BdrvChild *source; + BdrvChild *target; BdrvDirtyBitmap *copy_bitmap; int64_t cluster_size; bool use_copy_range; @@ -66,8 +71,7 @@ typedef struct BlockCopyState { void *progress_opaque; } BlockCopyState; =20 -BlockCopyState *block_copy_state_new(BlockDriverState *source, - BlockDriverState *target, +BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, int64_t cluster_size, BdrvRequestFlags write_flags, Error **errp); @@ -84,6 +88,6 @@ int64_t block_copy_reset_unallocated(BlockCopyState *s, int64_t offset, int64_t *count); =20 int coroutine_fn block_copy(BlockCopyState *s, int64_t start, uint64_t byt= es, - bool *error_is_read, bool is_write_notifier); + bool *error_is_read); =20 #endif /* BLOCK_COPY_H */ diff --git a/include/block/block_int.h b/include/block/block_int.h index 2b113eb3c7..05056b308a 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -1197,6 +1197,7 @@ BlockJob *backup_job_create(const char *job_id, Block= DriverState *bs, BdrvDirtyBitmap *sync_bitmap, BitmapSyncMode bitmap_mode, bool compress, + const char *filter_node_name, BlockdevOnError on_source_error, BlockdevOnError on_target_error, int creation_flags, diff --git a/block/backup-top.c b/block/backup-top.c index 75a315744d..7cdb1f8eba 100644 --- a/block/backup-top.c +++ b/block/backup-top.c @@ -50,12 +50,11 @@ static coroutine_fn int backup_top_co_preadv( static coroutine_fn int backup_top_cbw(BlockDriverState *bs, uint64_t offs= et, uint64_t bytes) { - /* - * Here we'd like to use block_copy(), but block-copy need to be moved= to - * use BdrvChildren to correctly use it in backup-top filter. It's a T= ODO. - */ + BDRVBackupTopState *s =3D bs->opaque; + uint64_t end =3D QEMU_ALIGN_UP(offset + bytes, s->bcs->cluster_size); + uint64_t off =3D QEMU_ALIGN_DOWN(offset, s->bcs->cluster_size); =20 - abort(); + return block_copy(s->bcs, off, end - off, NULL); } =20 static int coroutine_fn backup_top_co_pdiscard(BlockDriverState *bs, @@ -228,14 +227,10 @@ BlockDriverState *bdrv_backup_top_append(BlockDriverS= tate *source, goto failed_after_append; } =20 - /* - * TODO: Create block-copy-state here (which will utilize @cluster_siz= e and - * @write_flags parameters which are unused now). For this, block-copy - * should be refactored to use BdrvChildren. - */ - state->bcs =3D NULL; - if (!state->bcs) { - error_setg(&local_err, "Cannot create block-copy-state"); + state->bcs =3D block_copy_state_new(top->backing, state->target, + cluster_size, write_flags, &local_er= r); + if (local_err) { + error_prepend(&local_err, "Cannot create block-copy-state: "); goto failed_after_append; } *bcs =3D state->bcs; diff --git a/block/backup.c b/block/backup.c index 1057ed0a4e..46978c1785 100644 --- a/block/backup.c +++ b/block/backup.c @@ -2,6 +2,7 @@ * QEMU backup * * Copyright (C) 2013 Proxmox Server Solutions + * Copyright (c) 2019 Virtuozzo International GmbH. * * Authors: * Dietmar Maurer (dietmar@proxmox.com) @@ -27,10 +28,13 @@ #include "qemu/bitmap.h" #include "qemu/error-report.h" =20 +#include "block/backup-top.h" + #define BACKUP_CLUSTER_SIZE_DEFAULT (1 << 16) =20 typedef struct BackupBlockJob { BlockJob common; + BlockDriverState *backup_top; BlockDriverState *source_bs; =20 BdrvDirtyBitmap *sync_bitmap; @@ -39,11 +43,9 @@ typedef struct BackupBlockJob { BitmapSyncMode bitmap_mode; BlockdevOnError on_source_error; BlockdevOnError on_target_error; - CoRwlock flush_rwlock; uint64_t len; uint64_t bytes_read; int64_t cluster_size; - NotifierWithReturn before_write; =20 BlockCopyState *bcs; } BackupBlockJob; @@ -68,43 +70,23 @@ static void backup_progress_reset_callback(void *opaque) =20 static int coroutine_fn backup_do_cow(BackupBlockJob *job, int64_t offset, uint64_t bytes, - bool *error_is_read, - bool is_write_notifier) + bool *error_is_read) { int ret =3D 0; int64_t start, end; /* bytes */ =20 - qemu_co_rwlock_rdlock(&job->flush_rwlock); - start =3D QEMU_ALIGN_DOWN(offset, job->cluster_size); end =3D QEMU_ALIGN_UP(bytes + offset, job->cluster_size); =20 trace_backup_do_cow_enter(job, start, offset, bytes); =20 - ret =3D block_copy(job->bcs, start, end - start, error_is_read, - is_write_notifier); + ret =3D block_copy(job->bcs, start, end - start, error_is_read); =20 trace_backup_do_cow_return(job, offset, bytes, ret); =20 - qemu_co_rwlock_unlock(&job->flush_rwlock); - return ret; } =20 -static int coroutine_fn backup_before_write_notify( - NotifierWithReturn *notifier, - void *opaque) -{ - BackupBlockJob *job =3D container_of(notifier, BackupBlockJob, before_= write); - BdrvTrackedRequest *req =3D opaque; - - assert(req->bs =3D=3D job->source_bs); - assert(QEMU_IS_ALIGNED(req->offset, BDRV_SECTOR_SIZE)); - assert(QEMU_IS_ALIGNED(req->bytes, BDRV_SECTOR_SIZE)); - - return backup_do_cow(job, req->offset, req->bytes, NULL, true); -} - static void backup_cleanup_sync_bitmap(BackupBlockJob *job, int ret) { BdrvDirtyBitmap *bm; @@ -154,7 +136,7 @@ static void backup_clean(Job *job) { BackupBlockJob *s =3D container_of(job, BackupBlockJob, common.job); =20 - block_copy_state_free(s->bcs); + bdrv_backup_top_drop(s->backup_top); } =20 void backup_do_checkpoint(BlockJob *job, Error **errp) @@ -220,8 +202,7 @@ static int coroutine_fn backup_loop(BackupBlockJob *job) if (yield_and_check(job)) { goto out; } - ret =3D backup_do_cow(job, offset, - job->cluster_size, &error_is_read, false); + ret =3D backup_do_cow(job, offset, job->cluster_size, &error_i= s_read); if (ret < 0 && backup_error_action(job, error_is_read, -ret) = =3D=3D BLOCK_ERROR_ACTION_REPORT) { @@ -265,13 +246,8 @@ static int coroutine_fn backup_run(Job *job, Error **e= rrp) BackupBlockJob *s =3D container_of(job, BackupBlockJob, common.job); int ret =3D 0; =20 - qemu_co_rwlock_init(&s->flush_rwlock); - backup_init_copy_bitmap(s); =20 - s->before_write.notify =3D backup_before_write_notify; - bdrv_add_before_write_notifier(s->source_bs, &s->before_write); - if (s->sync_mode =3D=3D MIRROR_SYNC_MODE_TOP) { int64_t offset =3D 0; int64_t count; @@ -309,12 +285,6 @@ static int coroutine_fn backup_run(Job *job, Error **e= rrp) } =20 out: - notifier_with_return_remove(&s->before_write); - - /* wait until pending backup_do_cow() calls have completed */ - qemu_co_rwlock_wrlock(&s->flush_rwlock); - qemu_co_rwlock_unlock(&s->flush_rwlock); - return ret; } =20 @@ -372,6 +342,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, MirrorSyncMode sync_mode, BdrvDirtyBitmap *sync_bitmap, BitmapSyncMode bitmap_mode, bool compress, + const char *filter_node_name, BlockdevOnError on_source_error, BlockdevOnError on_target_error, int creation_flags, @@ -382,6 +353,8 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, BackupBlockJob *job =3D NULL; int64_t cluster_size; BdrvRequestFlags write_flags; + BlockDriverState *backup_top =3D NULL; + BlockCopyState *bcs =3D NULL; =20 assert(bs); assert(target); @@ -463,33 +436,35 @@ BlockJob *backup_job_create(const char *job_id, Block= DriverState *bs, write_flags =3D (bdrv_chain_contains(target, bs) ? BDRV_REQ_SERIALISIN= G : 0) | (compress ? BDRV_REQ_WRITE_COMPRESSED : 0), =20 + backup_top =3D bdrv_backup_top_append(bs, target, filter_node_name, + cluster_size, write_flags, &bcs, e= rrp); + if (!backup_top) { + goto error; + } + /* job->len is fixed, so we can't allow resize */ - job =3D block_job_create(job_id, &backup_job_driver, txn, bs, 0, BLK_P= ERM_ALL, + job =3D block_job_create(job_id, &backup_job_driver, txn, backup_top, + 0, BLK_PERM_ALL, speed, creation_flags, cb, opaque, errp); if (!job) { goto error; } =20 + job->backup_top =3D backup_top; job->source_bs =3D bs; job->on_source_error =3D on_source_error; job->on_target_error =3D on_target_error; job->sync_mode =3D sync_mode; job->sync_bitmap =3D sync_bitmap; job->bitmap_mode =3D bitmap_mode; - - job->bcs =3D block_copy_state_new(bs, target, cluster_size, write_flag= s, - errp); - if (!job->bcs) { - goto error; - } - + job->bcs =3D bcs; job->cluster_size =3D cluster_size; job->len =3D len; =20 - block_copy_set_callbacks(job->bcs, backup_progress_bytes_callback, + block_copy_set_callbacks(bcs, backup_progress_bytes_callback, backup_progress_reset_callback, job); =20 - /* Required permissions are already taken by block-copy-state target */ + /* Required permissions are already taken by backup-top target */ block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL, &error_abort); =20 @@ -502,6 +477,8 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, if (job) { backup_clean(&job->common.job); job_early_fail(&job->common.job); + } else if (backup_top) { + bdrv_backup_top_drop(backup_top); } =20 return NULL; diff --git a/block/block-copy.c b/block/block-copy.c index fcb112da14..0f76ea1e63 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -60,24 +60,22 @@ void block_copy_state_free(BlockCopyState *s) return; } =20 - bdrv_release_dirty_bitmap(blk_bs(s->source), s->copy_bitmap); - blk_unref(s->source); - blk_unref(s->target); + bdrv_release_dirty_bitmap(s->source->bs, s->copy_bitmap); g_free(s); } =20 -BlockCopyState *block_copy_state_new(BlockDriverState *source, - BlockDriverState *target, +BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, int64_t cluster_size, BdrvRequestFlags write_flags, Error *= *errp) { BlockCopyState *s; - int ret; - uint64_t no_resize =3D BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE | - BLK_PERM_WRITE_UNCHANGED | BLK_PERM_GRAPH_MOD; BdrvDirtyBitmap *copy_bitmap; + uint32_t max_transfer =3D + MIN_NON_ZERO(INT_MAX, MIN_NON_ZERO(source->bs->bl.max_transfer, + target->bs->bl.max_transfer= )); =20 - copy_bitmap =3D bdrv_create_dirty_bitmap(source, cluster_size, NULL, e= rrp); + copy_bitmap =3D bdrv_create_dirty_bitmap(source->bs, cluster_size, NUL= L, + errp); if (!copy_bitmap) { return NULL; } @@ -85,19 +83,15 @@ BlockCopyState *block_copy_state_new(BlockDriverState *= source, =20 s =3D g_new(BlockCopyState, 1); *s =3D (BlockCopyState) { - .source =3D blk_new(bdrv_get_aio_context(source), - BLK_PERM_CONSISTENT_READ, no_resize), - .target =3D blk_new(bdrv_get_aio_context(target), - BLK_PERM_WRITE, no_resize), + .source =3D source, + .target =3D target, .copy_bitmap =3D copy_bitmap, .cluster_size =3D cluster_size, .len =3D bdrv_dirty_bitmap_size(copy_bitmap), .write_flags =3D write_flags, }; =20 - s->copy_range_size =3D QEMU_ALIGN_DOWN(MIN(blk_get_max_transfer(s->sou= rce), - blk_get_max_transfer(s->targe= t)), - s->cluster_size); + s->copy_range_size =3D QEMU_ALIGN_DOWN(max_transfer, cluster_size), /* * Set use_copy_range, consider the following: * 1. Compression is not supported for copy_range. @@ -111,32 +105,7 @@ BlockCopyState *block_copy_state_new(BlockDriverState = *source, =20 QLIST_INIT(&s->inflight_reqs); =20 - /* - * We just allow aio context change on our block backends. block_copy(= ) user - * (now it's only backup) is responsible for source and target being i= n same - * aio context. - */ - blk_set_disable_request_queuing(s->source, true); - blk_set_allow_aio_context_change(s->source, true); - blk_set_disable_request_queuing(s->target, true); - blk_set_allow_aio_context_change(s->target, true); - - ret =3D blk_insert_bs(s->source, source, errp); - if (ret < 0) { - goto fail; - } - - ret =3D blk_insert_bs(s->target, target, errp); - if (ret < 0) { - goto fail; - } - return s; - -fail: - block_copy_state_free(s); - - return NULL; } =20 void block_copy_set_callbacks( @@ -157,22 +126,20 @@ void block_copy_set_callbacks( static int coroutine_fn block_copy_with_bounce_buffer(BlockCopyState *s, int64_t start, int64_t end, - bool is_write_notifi= er, bool *error_is_read, void **bounce_buffer) { int ret; int nbytes; - int read_flags =3D is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0; =20 assert(QEMU_IS_ALIGNED(start, s->cluster_size)); bdrv_reset_dirty_bitmap(s->copy_bitmap, start, s->cluster_size); nbytes =3D MIN(s->cluster_size, s->len - start); if (!*bounce_buffer) { - *bounce_buffer =3D blk_blockalign(s->source, s->cluster_size); + *bounce_buffer =3D qemu_blockalign(s->source->bs, s->cluster_size); } =20 - ret =3D blk_co_pread(s->source, start, nbytes, *bounce_buffer, read_fl= ags); + ret =3D bdrv_co_pread(s->source, start, nbytes, *bounce_buffer, 0); if (ret < 0) { trace_block_copy_with_bounce_buffer_read_fail(s, start, ret); if (error_is_read) { @@ -181,8 +148,8 @@ static int coroutine_fn block_copy_with_bounce_buffer(B= lockCopyState *s, goto fail; } =20 - ret =3D blk_co_pwrite(s->target, start, nbytes, *bounce_buffer, - s->write_flags); + ret =3D bdrv_co_pwrite(s->target, start, nbytes, *bounce_buffer, + s->write_flags); if (ret < 0) { trace_block_copy_with_bounce_buffer_write_fail(s, start, ret); if (error_is_read) { @@ -204,13 +171,11 @@ fail: */ static int coroutine_fn block_copy_with_offload(BlockCopyState *s, int64_t start, - int64_t end, - bool is_write_notifier) + int64_t end) { int ret; int nr_clusters; int nbytes; - int read_flags =3D is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0; =20 assert(QEMU_IS_ALIGNED(s->copy_range_size, s->cluster_size)); assert(QEMU_IS_ALIGNED(start, s->cluster_size)); @@ -218,8 +183,8 @@ static int coroutine_fn block_copy_with_offload(BlockCo= pyState *s, nr_clusters =3D DIV_ROUND_UP(nbytes, s->cluster_size); bdrv_reset_dirty_bitmap(s->copy_bitmap, start, s->cluster_size * nr_clusters); - ret =3D blk_co_copy_range(s->source, start, s->target, start, nbytes, - read_flags, s->write_flags); + ret =3D bdrv_co_copy_range(s->source, start, s->target, start, nbytes, + 0, s->write_flags); if (ret < 0) { trace_block_copy_with_offload_fail(s, start, ret); bdrv_set_dirty_bitmap(s->copy_bitmap, start, @@ -237,7 +202,7 @@ static int coroutine_fn block_copy_with_offload(BlockCo= pyState *s, static int block_copy_is_cluster_allocated(BlockCopyState *s, int64_t offs= et, int64_t *pnum) { - BlockDriverState *bs =3D blk_bs(s->source); + BlockDriverState *bs =3D s->source->bs; int64_t count, total_count =3D 0; int64_t bytes =3D s->len - offset; int ret; @@ -302,8 +267,7 @@ int64_t block_copy_reset_unallocated(BlockCopyState *s, =20 int coroutine_fn block_copy(BlockCopyState *s, int64_t start, uint64_t bytes, - bool *error_is_read, - bool is_write_notifier) + bool *error_is_read) { int ret =3D 0; int64_t end =3D bytes + start; /* bytes */ @@ -315,7 +279,8 @@ int coroutine_fn block_copy(BlockCopyState *s, * block_copy() user is responsible for keeping source and target in s= ame * aio context */ - assert(blk_get_aio_context(s->source) =3D=3D blk_get_aio_context(s->ta= rget)); + assert(bdrv_get_aio_context(s->source->bs) =3D=3D + bdrv_get_aio_context(s->target->bs)); =20 assert(QEMU_IS_ALIGNED(start, s->cluster_size)); assert(QEMU_IS_ALIGNED(end, s->cluster_size)); @@ -352,15 +317,13 @@ int coroutine_fn block_copy(BlockCopyState *s, trace_block_copy_process(s, start); =20 if (s->use_copy_range) { - ret =3D block_copy_with_offload(s, start, dirty_end, - is_write_notifier); + ret =3D block_copy_with_offload(s, start, dirty_end); if (ret < 0) { s->use_copy_range =3D false; } } if (!s->use_copy_range) { ret =3D block_copy_with_bounce_buffer(s, start, dirty_end, - is_write_notifier, error_is_read, &bounce_buf= fer); } if (ret < 0) { diff --git a/block/replication.c b/block/replication.c index 936b2f8b5a..99532ce521 100644 --- a/block/replication.c +++ b/block/replication.c @@ -543,7 +543,7 @@ static void replication_start(ReplicationState *rs, Rep= licationMode mode, =20 s->backup_job =3D backup_job_create( NULL, s->secondary_disk->bs, s->hidden_dis= k->bs, - 0, MIRROR_SYNC_MODE_NONE, NULL, 0, false, + 0, MIRROR_SYNC_MODE_NONE, NULL, 0, false, = NULL, BLOCKDEV_ON_ERROR_REPORT, BLOCKDEV_ON_ERROR_REPORT, JOB_INTERNAL, backup_job_completed, bs, NULL, &local_err= ); diff --git a/blockdev.c b/blockdev.c index fbef6845c8..f89e48fc79 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3601,6 +3601,7 @@ static BlockJob *do_backup_common(BackupCommon *backu= p, job =3D backup_job_create(backup->job_id, bs, target_bs, backup->speed, backup->sync, bmap, backup->bitmap_mode, backup->compress, + backup->filter_node_name, backup->on_source_error, backup->on_target_error, job_flags, NULL, NULL, txn, errp); diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056 index 98c55d8e5a..f39287c162 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.dest_img2 =3D img_create('dest2') self.ref_img =3D img_create('ref') self.vm.add_drive(self.test_img) self.vm.launch() @@ -141,6 +142,7 @@ class BackupTest(iotests.QMPTestCase): self.vm.shutdown() try_remove(self.test_img) try_remove(self.dest_img) + try_remove(self.dest_img2) try_remove(self.ref_img) =20 def hmp_io_writes(self, drive, patterns): @@ -253,9 +255,9 @@ class BackupTest(iotests.QMPTestCase): res =3D self.vm.qmp('query-block-jobs') self.assert_qmp(res, 'return[0]/status', 'concluded') # Leave zombie job un-dismissed, observe a failure: - res =3D self.qmp_backup_and_wait(serror=3D"Node 'drive0' is busy: = block device is in use by block job: backup", + res =3D self.qmp_backup_and_wait(serror=3D"Job ID 'drive0' already= in use", device=3D'drive0', format=3Diotests= .imgfmt, - sync=3D'full', target=3Dself.dest_i= mg, + sync=3D'full', target=3Dself.dest_i= mg2, auto_dismiss=3DFalse) self.assertEqual(res, False) # OK, dismiss the zombie. @@ -265,7 +267,7 @@ class BackupTest(iotests.QMPTestCase): self.assert_qmp(res, 'return', []) # Ensure it's really gone. self.qmp_backup_and_wait(device=3D'drive0', format=3Diotests.imgfm= t, - sync=3D'full', target=3Dself.dest_img, + sync=3D'full', target=3Dself.dest_img2, auto_dismiss=3DFalse) =20 def dismissal_failure(self, dismissal_opt): diff --git a/tests/qemu-iotests/141.out b/tests/qemu-iotests/141.out index dbd3bdef6c..e3b578282d 100644 --- a/tests/qemu-iotests/141.out +++ b/tests/qemu-iotests/141.out @@ -10,7 +10,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D10485= 76 backing_file=3DTEST_DIR/m. Formatting 'TEST_DIR/o.IMGFMT', fmt=3DIMGFMT size=3D1048576 backing_file= =3DTEST_DIR/t.IMGFMT backing_fmt=3DIMGFMT {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "job0"}} -{"error": {"class": "GenericError", "desc": "Node drv0 is in use"}} +{"error": {"class": "GenericError", "desc": "Node 'drv0' is busy: node is = used as backing hd of 'NODE_NAME'"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "aborting", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "BLOCK_JOB_CANCELLED", "data": {"device": "job0", "len": 1048576, "offset= ": 0, "speed": 0, "type": "backup"}} diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index de8b45f094..a9828251cf 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -190,6 +190,7 @@ def blockdev_backup(vm, device, target, sync, **kwargs): device=3Ddevice, target=3Dtarget, sync=3Dsync, + filter_node_name=3D'backup-top', **kwargs) return result =20 @@ -216,7 +217,7 @@ def backup(drive, n, filepath, sync, **kwargs): job_id=3Djob_id, **kwargs) return job_id =20 -def perform_writes(drive, n): +def perform_writes(drive, n, filter_node_name=3DNone): log("--- Write #{:d} ---\n".format(n)) for pattern in GROUPS[n].patterns: cmd =3D "write -P{:s} 0x{:07x} 0x{:x}".format( @@ -224,7 +225,7 @@ def perform_writes(drive, n): pattern.offset, pattern.size) log(cmd) - log(drive.vm.hmp_qemu_io(drive.node, cmd)) + log(drive.vm.hmp_qemu_io(filter_node_name or drive.node, cmd)) bitmaps =3D drive.vm.query_bitmaps() log({'bitmaps': bitmaps}, indent=3D2) log('') @@ -355,7 +356,7 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap',= failure=3DNone): """Issue writes while the job is open to test bitmap divergenc= e.""" # Note: when `failure` is 'intermediate', this isn't called. log('') - bitmaps =3D perform_writes(drive0, 2) + bitmaps =3D perform_writes(drive0, 2, filter_node_name=3D'back= up-top') # Named bitmap (static, should be unchanged) ebitmap.compare(vm.get_bitmap(drive0.node, 'bitmap0', bitmaps=3Dbitmaps)) diff --git a/tests/qemu-iotests/257.out b/tests/qemu-iotests/257.out index ec7e25877b..64dd460055 100644 --- a/tests/qemu-iotests/257.out +++ b/tests/qemu-iotests/257.out @@ -30,7 +30,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -78,7 +78,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -92,7 +92,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": "back= up_1", "sync": "bitmap", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backu= p_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -205,7 +205,7 @@ expecting 15 dirty sectors; have 15. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -219,7 +219,7 @@ 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": "back= up_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backu= p_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -290,7 +290,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -338,7 +338,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -354,7 +354,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": "back= up_1", "sync": "bitmap", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backu= p_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": 3932= 16, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} @@ -416,7 +416,7 @@ expecting 14 dirty sectors; have 14. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -430,7 +430,7 @@ 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": "back= up_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backu= p_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -501,7 +501,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -549,7 +549,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -563,7 +563,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": "back= up_1", "sync": "bitmap", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backu= p_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -676,7 +676,7 @@ expecting 15 dirty sectors; have 15. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -690,7 +690,7 @@ 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": "back= up_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-na= me": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backu= p_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -761,7 +761,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -809,7 +809,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -823,7 +823,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": = "backup_1", "sync": "bitmap", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "= backup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -936,7 +936,7 @@ expecting 15 dirty sectors; have 15. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -950,7 +950,7 @@ 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": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "= backup_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -1021,7 +1021,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1069,7 +1069,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1085,7 +1085,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": = "backup_1", "sync": "bitmap", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "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": 3932= 16, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} @@ -1147,7 +1147,7 @@ expecting 14 dirty sectors; have 14. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1161,7 +1161,7 @@ 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": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "= backup_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -1232,7 +1232,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1280,7 +1280,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1294,7 +1294,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": = "backup_1", "sync": "bitmap", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "= backup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -1407,7 +1407,7 @@ expecting 12 dirty sectors; have 12. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1421,7 +1421,7 @@ 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": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "= backup_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -1492,7 +1492,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1540,7 +1540,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1554,7 +1554,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": "bac= kup_1", "sync": "bitmap", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "back= up_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -1667,7 +1667,7 @@ expecting 12 dirty sectors; have 12. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1681,7 +1681,7 @@ 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": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "back= up_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -1752,7 +1752,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1800,7 +1800,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1816,7 +1816,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": "bac= kup_1", "sync": "bitmap", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "back= up_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": 3932= 16, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} @@ -1878,7 +1878,7 @@ expecting 13 dirty sectors; have 13. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -1892,7 +1892,7 @@ 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": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "back= up_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -1963,7 +1963,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2011,7 +2011,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2025,7 +2025,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": "bac= kup_1", "sync": "bitmap", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "back= up_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -2138,7 +2138,7 @@ expecting 12 dirty sectors; have 12. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2152,7 +2152,7 @@ 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": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "back= up_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -2223,7 +2223,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2271,7 +2271,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2285,7 +2285,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": = "backup_1", "sync": "full", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_1", "sync": "full", "target": "ba= ckup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -2398,7 +2398,7 @@ expecting 15 dirty sectors; have 15. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2412,7 +2412,7 @@ 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": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "= backup_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -2483,7 +2483,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2531,7 +2531,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2547,7 +2547,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": = "backup_1", "sync": "full", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_1", "sync": "full", "target": "ba= ckup_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"}} @@ -2609,7 +2609,7 @@ expecting 14 dirty sectors; have 14. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2623,7 +2623,7 @@ 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": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "= backup_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -2694,7 +2694,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2742,7 +2742,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2756,7 +2756,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": = "backup_1", "sync": "full", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_1", "sync": "full", "target": "ba= ckup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -2869,7 +2869,7 @@ expecting 12 dirty sectors; have 12. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -2883,7 +2883,7 @@ 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": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "= backup_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -2954,7 +2954,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3002,7 +3002,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3016,7 +3016,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": "bac= kup_1", "sync": "full", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_1", "sync": "full", "target": "backup= _target_1"}} {"return": {}} =20 --- Write #2 --- @@ -3129,7 +3129,7 @@ expecting 12 dirty sectors; have 12. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3143,7 +3143,7 @@ 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": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "back= up_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -3214,7 +3214,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3262,7 +3262,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3278,7 +3278,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": "bac= kup_1", "sync": "full", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "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"}} @@ -3340,7 +3340,7 @@ expecting 1014 dirty sectors; have 1014. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3354,7 +3354,7 @@ expecting 1014 dirty sectors; have 1014. 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": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "back= up_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -3425,7 +3425,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3473,7 +3473,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3487,7 +3487,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": "bac= kup_1", "sync": "full", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_1", "sync": "full", "target": "backup= _target_1"}} {"return": {}} =20 --- Write #2 --- @@ -3600,7 +3600,7 @@ expecting 12 dirty sectors; have 12. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3614,7 +3614,7 @@ 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": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "back= up_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -3685,7 +3685,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3733,7 +3733,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3747,7 +3747,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": = "backup_1", "sync": "top", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_1", "sync": "top", "target": "bac= kup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -3860,7 +3860,7 @@ expecting 15 dirty sectors; have 15. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3874,7 +3874,7 @@ 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": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "= backup_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -3945,7 +3945,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -3993,7 +3993,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4009,7 +4009,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": = "backup_1", "sync": "top", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_1", "sync": "top", "target": "bac= kup_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": 4587= 52, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} @@ -4071,7 +4071,7 @@ expecting 14 dirty sectors; have 14. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4085,7 +4085,7 @@ 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": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "= backup_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -4156,7 +4156,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4204,7 +4204,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4218,7 +4218,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": = "backup_1", "sync": "top", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_1", "sync": "top", "target": "bac= kup_target_1"}} {"return": {}} =20 --- Write #2 --- @@ -4331,7 +4331,7 @@ expecting 12 dirty sectors; have 12. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4345,7 +4345,7 @@ 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": = "backup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-no= de-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "= backup_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -4416,7 +4416,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4464,7 +4464,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4478,7 +4478,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": "bac= kup_1", "sync": "top", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_1", "sync": "top", "target": "backup_= target_1"}} {"return": {}} =20 --- Write #2 --- @@ -4591,7 +4591,7 @@ expecting 12 dirty sectors; have 12. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4605,7 +4605,7 @@ 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": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "back= up_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -4676,7 +4676,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4724,7 +4724,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4740,7 +4740,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": "bac= kup_1", "sync": "top", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "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": 4587= 52, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COM= PLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} @@ -4802,7 +4802,7 @@ expecting 14 dirty sectors; have 14. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4816,7 +4816,7 @@ 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": "always", "device": "drive0", "job-id": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "back= up_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -4887,7 +4887,7 @@ write -P0x76 0x3ff0000 0x10000 {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4935,7 +4935,7 @@ expecting 6 dirty sectors; have 6. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -4949,7 +4949,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": "bac= kup_1", "sync": "top", "target": "backup_target_1"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_1", "sync": "top", "target": "backup_= target_1"}} {"return": {}} =20 --- Write #2 --- @@ -5062,7 +5062,7 @@ expecting 12 dirty sectors; have 12. OK! {"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"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "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"}} =20 @@ -5076,7 +5076,7 @@ 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": "bac= kup_2", "sync": "bitmap", "target": "backup_target_2"}} +{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitm= ap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-n= ame": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "back= up_target_2"}} {"return": {}} {"execute": "job-finalize", "arguments": {"id": "backup_2"}} {"return": {}} @@ -5139,155 +5139,155 @@ qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID= -fbackup2" =3D=3D> Identical, OK! =20 -- Sync mode incremental tests -- =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "= backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", = "sync": "incremental", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'incremental' sync mode"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "job-id": "api_job", "sync": "incremental", "target": "back= up_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "syn= c": "incremental", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'incremental' sync mode"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backu= p_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync= ": "incremental", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'incremental' sync mode"}} =20 -{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "api_job", "sync": "incremental", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "job-id": "api_job", "sync": "incremental", "targe= t": "backup_target"}} {"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'incremental' sync mode"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "in= cremental", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top"= , "job-id": "api_job", "sync": "incremental", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "increm= ental", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "j= ob-id": "api_job", "sync": "incremental", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "increme= ntal", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "jo= b-id": "api_job", "sync": "incremental", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup= _target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync"= : "incremental", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "always", "device": "drive0", "job-id": "api_job", "sync": "incremen= tal", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job= -id": "api_job", "sync": "incremental", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "job-id": "api_job", "sync": "increment= al", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-= id": "api_job", "sync": "incremental", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-= success' when using sync mode 'incremental'"}} =20 -- Sync mode bitmap tests -- =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backu= p_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", = "sync": "bitmap", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'bitmap' sync mode"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_ta= rget"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "syn= c": "bitmap", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'bitmap' sync mode"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_tar= get"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync= ": "bitmap", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'bitmap' sync mode"}} =20 -{"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id":= "api_job", "sync": "bitmap", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-n= ode-name": "backup-top", "job-id": "api_job", "sync": "bitmap", "target": "= backup_target"}} {"error": {"class": "GenericError", "desc": "must provide a valid bitmap n= ame for 'bitmap' sync mode"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "bi= tmap", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top"= , "job-id": "api_job", "sync": "bitmap", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "bitmap= ", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "j= ob-id": "api_job", "sync": "bitmap", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "bitmap"= , "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "jo= b-id": "api_job", "sync": "bitmap", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_targ= et"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync"= : "bitmap", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target= "}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "filter-node-name": "backup-top", "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 -- =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_= target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", = "sync": "full", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_targ= et"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "syn= c": "full", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_targe= t"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync= ": "full", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "fu= ll", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top"= , "job-id": "api_job", "sync": "full", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "full",= "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "j= ob-id": "api_job", "sync": "full", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "full", = "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "jo= b-id": "api_job", "sync": "full", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target= "}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync"= : "full", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "job-id": "api_job", "sync": "full", "t= arget": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-= id": "api_job", "sync": "full", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap sync mode 'never' has = no meaningful effect when combined with sync mode 'full'"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": = "full", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be give= n when providing a bitmap"}} =20 -- Sync mode top tests -- =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_t= arget"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", = "sync": "top", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_targe= t"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "syn= c": "top", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target= "}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync= ": "top", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "to= p", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top"= , "job-id": "api_job", "sync": "top", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "top", = "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "j= ob-id": "api_job", "sync": "top", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "top", "= target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "jo= b-id": "api_job", "sync": "top", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"= }} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync"= : "top", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "job-id": "api_job", "sync": "top", "ta= rget": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-= id": "api_job", "sync": "top", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap sync mode 'never' has = no meaningful effect when combined with sync mode 'top'"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": = "top", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be give= n when providing a bitmap"}} =20 -- Sync mode none tests -- =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_= target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", = "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", = "sync": "none", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_targ= et"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "dev= ice": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "syn= c": "none", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_targe= t"}} +{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "devi= ce": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync= ": "none", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mo= de without a bitmap"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "no= ne", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top"= , "job-id": "api_job", "sync": "none", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "none",= "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "j= ob-id": "api_job", "sync": "none", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "none", = "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitma= p-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "jo= b-id": "api_job", "sync": "none", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target= "}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "devic= e": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync"= : "none", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not = be found"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "none= ", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", = "job-id": "api_job", "sync": "none", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "sync mode 'none' does not pro= duce meaningful bitmap outputs"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "always", "device": "drive0", "job-id": "api_job", "sync": "none", "= target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job= -id": "api_job", "sync": "none", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "sync mode 'none' does not pro= duce meaningful bitmap outputs"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "job-id": "api_job", "sync": "none", "t= arget": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-= mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-= id": "api_job", "sync": "none", "target": "backup_target"}} {"error": {"class": "GenericError", "desc": "sync mode 'none' does not pro= duce meaningful bitmap outputs"}} =20 -{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}} +{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device"= : "drive0", "filter-node-name": "backup-top", "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 --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710970; cv=none; d=zoho.com; s=zohoarc; b=RLFi0TjDeceEMf6/JgReLhuNV3bZCf6ycbdVITP80Rc83FWZVMKzGMNgK5eISIYqs58OxGe74xWtTKQNtcpAX4ROeolQRYXdEc2FK9DzfnbObSSMOLTXP+oi+F37XIG9AmhVLyXgbsTuUcSa3auiXOr4wZrEF0EcooeCcSc15D8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710970; 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; bh=rABwvLW9B7EtAhrJeqls4Lt2sAez+//35RxgGEpRgbE=; b=Gla53PWhEp43LenYWCK0hOkP19Qz17r43/0n3tpGKVUg2lMR8yx3jIiIKIs2BZJPobaj/zYdQ1hWZmcTGFQK5se8v6lcEdCXWvlNgaEQ05zvVF1o9D5LY8T4g6M0kNErIb3JLSV/Y1UgJVMsdiYqvXdagB1zUzDUHKOluhtg7cQ= 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 1570710970407889.3701636750253; Thu, 10 Oct 2019 05:36:10 -0700 (PDT) Received: from localhost ([::1]:37374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXfk-0000Me-RN for importer@patchew.org; Thu, 10 Oct 2019 08:36:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52370) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrq-0007RJ-Tc for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWro-0008V7-LM for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42956) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrj-0008Sb-Ao; Thu, 10 Oct 2019 07:44:19 -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 E0483C049E17; Thu, 10 Oct 2019 11:44:17 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8511A5DA2C; Thu, 10 Oct 2019 11:44:17 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 34/36] nbd: add empty .bdrv_reopen_prepare Date: Thu, 10 Oct 2019 13:42:58 +0200 Message-Id: <20191010114300.7746-35-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.31]); Thu, 10 Oct 2019 11:44:17 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Maxim Levitsky Fixes commit job / qemu-img commit, when commiting qcow2 file which is based on nbd export. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=3D1718727 Signed-off-by: Maxim Levitsky Message-id: 20190930213820.29777-2-mlevitsk@redhat.com Signed-off-by: Max Reitz --- block/nbd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/block/nbd.c b/block/nbd.c index 813c40d8f0..fd78e5f330 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1158,6 +1158,18 @@ static int coroutine_fn nbd_client_co_block_status( BDRV_BLOCK_OFFSET_VALID; } =20 +static int nbd_client_reopen_prepare(BDRVReopenState *state, + BlockReopenQueue *queue, Error **errp) +{ + BDRVNBDState *s =3D (BDRVNBDState *)state->bs->opaque; + + if ((state->flags & BDRV_O_RDWR) && (s->info.flags & NBD_FLAG_READ_ONL= Y)) { + error_setg(errp, "Can't reopen read-only NBD mount as read/write"); + return -EACCES; + } + return 0; +} + static void nbd_client_close(BlockDriverState *bs) { BDRVNBDState *s =3D (BDRVNBDState *)bs->opaque; @@ -1798,6 +1810,7 @@ static BlockDriver bdrv_nbd =3D { .instance_size =3D sizeof(BDRVNBDState), .bdrv_parse_filename =3D nbd_parse_filename, .bdrv_file_open =3D nbd_open, + .bdrv_reopen_prepare =3D nbd_client_reopen_prepare, .bdrv_co_preadv =3D nbd_client_co_preadv, .bdrv_co_pwritev =3D nbd_client_co_pwritev, .bdrv_co_pwrite_zeroes =3D nbd_client_co_pwrite_zeroes, @@ -1820,6 +1833,7 @@ static BlockDriver bdrv_nbd_tcp =3D { .instance_size =3D sizeof(BDRVNBDState), .bdrv_parse_filename =3D nbd_parse_filename, .bdrv_file_open =3D nbd_open, + .bdrv_reopen_prepare =3D nbd_client_reopen_prepare, .bdrv_co_preadv =3D nbd_client_co_preadv, .bdrv_co_pwritev =3D nbd_client_co_pwritev, .bdrv_co_pwrite_zeroes =3D nbd_client_co_pwrite_zeroes, @@ -1842,6 +1856,7 @@ static BlockDriver bdrv_nbd_unix =3D { .instance_size =3D sizeof(BDRVNBDState), .bdrv_parse_filename =3D nbd_parse_filename, .bdrv_file_open =3D nbd_open, + .bdrv_reopen_prepare =3D nbd_client_reopen_prepare, .bdrv_co_preadv =3D nbd_client_co_preadv, .bdrv_co_pwritev =3D nbd_client_co_pwritev, .bdrv_co_pwrite_zeroes =3D nbd_client_co_pwrite_zeroes, --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710132; cv=none; d=zoho.com; s=zohoarc; b=hy/NrVnfyXUaKlpKbqPd4Vlc9ItYdw+Q43zTwWVf5+UDcH0Pt+wl0xsJbB2/YcnoEY85HNx2tGkAUsdEdZpo6Vg/xHmNgZAJtHke/Dxyd+M4IEZzObEj5TIaHzUBw8ZXO3zPCxZJz5d/8HWfVqN6nd1XIWdGZpKzZfy8n3kyARw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710132; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tgt1x1WXWTEURKDhDF3z0ttd1zVOwICGUfdyRrbc8UI=; b=iyK2PIHU043nmw+sqYYAMoIi/LqJAVx81C7K2KYnbXxNZFfotSNMPKgIjT7FLLr7spRCUTciawC2tDdjfwz2f5gHHtY959uGeEjaeBhvy3NTVikLCS7otfGmpUqWUEB2ZI4hEkI5rO7jXoF6KwtAGP0wN6N9OzQL2uiQD8PVGXI= 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 1570710132276240.43248934731855; Thu, 10 Oct 2019 05:22:12 -0700 (PDT) Received: from localhost ([::1]:37128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXSH-0000H3-AA for importer@patchew.org; Thu, 10 Oct 2019 08:22:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52425) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWrw-0007Ug-Sd for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrs-00006q-Q4 for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59656) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWrl-0008TO-I0; Thu, 10 Oct 2019 07:44:21 -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 20CDB308FFB1; Thu, 10 Oct 2019 11:44:20 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90C465DA2C; Thu, 10 Oct 2019 11:44:19 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 35/36] tests: fix I/O test for hosts defaulting to LUKSv2 Date: Thu, 10 Oct 2019 13:42:59 +0200 Message-Id: <20191010114300.7746-36-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.49]); Thu, 10 Oct 2019 11:44:20 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Daniel P. Berrang=C3=A9 Some distros are now defaulting to LUKS version 2 which QEMU cannot process. For our I/O test that validates interoperability between the kernel/cryptsetup and QEMU, we need to explicitly ask for version 1 of the LUKS format. Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20190927101155.25896-1-berrange@redhat.com Tested-by: Maxim Levitsky Reviewed-by: Maxim Levitsky Signed-off-by: Max Reitz --- tests/qemu-iotests/149 | 2 +- tests/qemu-iotests/149.out | 44 +++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/qemu-iotests/149 b/tests/qemu-iotests/149 index 4f363f295f..8ab42e94c6 100755 --- a/tests/qemu-iotests/149 +++ b/tests/qemu-iotests/149 @@ -153,7 +153,7 @@ def cryptsetup_format(config): =20 (password, slot) =3D config.first_password() =20 - args =3D ["luksFormat"] + args =3D ["luksFormat", "--type", "luks1"] cipher =3D config.cipher + "-" + config.mode + "-" + config.ivgen if config.ivgen_hash is not None: cipher =3D cipher + ":" + config.ivgen_hash diff --git a/tests/qemu-iotests/149.out b/tests/qemu-iotests/149.out index 1407ce6dad..6877ab6c4a 100644 --- a/tests/qemu-iotests/149.out +++ b/tests/qemu-iotests/149.out @@ -2,7 +2,7 @@ # Create image truncate TEST_DIR/luks-aes-256-xts-plain64-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-plain64 --key-size 512 -= -hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-256-x= ts-plain64-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain64 --k= ey-size 512 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/l= uks-aes-256-xts-plain64-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-sha1.img = qiotest-145-aes-256-xts-plain64-sha1 # Write test pattern 0xa7 @@ -122,7 +122,7 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-sha1.img # Create image truncate TEST_DIR/luks-twofish-256-xts-plain64-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher twofish-xts-plain64 --key-size 5= 12 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-twofi= sh-256-xts-plain64-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher twofish-xts-plain64= --key-size 512 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_D= IR/luks-twofish-256-xts-plain64-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-twofish-256-xts-plain64-sha1.= img qiotest-145-twofish-256-xts-plain64-sha1 # Write test pattern 0xa7 @@ -242,7 +242,7 @@ unlink TEST_DIR/luks-twofish-256-xts-plain64-sha1.img # Create image truncate TEST_DIR/luks-serpent-256-xts-plain64-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher serpent-xts-plain64 --key-size 5= 12 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-serpe= nt-256-xts-plain64-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher serpent-xts-plain64= --key-size 512 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_D= IR/luks-serpent-256-xts-plain64-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-serpent-256-xts-plain64-sha1.= img qiotest-145-serpent-256-xts-plain64-sha1 # Write test pattern 0xa7 @@ -362,7 +362,7 @@ unlink TEST_DIR/luks-serpent-256-xts-plain64-sha1.img # Create image truncate TEST_DIR/luks-cast5-128-cbc-plain64-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher cast5-cbc-plain64 --key-size 128= --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-cast5-1= 28-cbc-plain64-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher cast5-cbc-plain64 -= -key-size 128 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR= /luks-cast5-128-cbc-plain64-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-cast5-128-cbc-plain64-sha1.im= g qiotest-145-cast5-128-cbc-plain64-sha1 # Write test pattern 0xa7 @@ -483,7 +483,7 @@ Skipping cast6-256-xts-plain64-sha1 in blacklist # Create image truncate TEST_DIR/luks-aes-256-cbc-plain-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-cbc-plain --key-size 256 --h= ash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-256-cbc= -plain-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-cbc-plain --key= -size 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luk= s-aes-256-cbc-plain-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-cbc-plain-sha1.img qi= otest-145-aes-256-cbc-plain-sha1 # Write test pattern 0xa7 @@ -603,7 +603,7 @@ unlink TEST_DIR/luks-aes-256-cbc-plain-sha1.img # Create image truncate TEST_DIR/luks-aes-256-cbc-plain64-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-cbc-plain64 --key-size 256 -= -hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-256-c= bc-plain64-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-cbc-plain64 --k= ey-size 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/l= uks-aes-256-cbc-plain64-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-cbc-plain64-sha1.img = qiotest-145-aes-256-cbc-plain64-sha1 # Write test pattern 0xa7 @@ -723,7 +723,7 @@ unlink TEST_DIR/luks-aes-256-cbc-plain64-sha1.img # Create image truncate TEST_DIR/luks-aes-256-cbc-essiv-sha256-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-cbc-essiv:sha256 --key-size = 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-= 256-cbc-essiv-sha256-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-cbc-essiv:sha25= 6 --key-size 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_= DIR/luks-aes-256-cbc-essiv-sha256-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-cbc-essiv-sha256-sha1= .img qiotest-145-aes-256-cbc-essiv-sha256-sha1 # Write test pattern 0xa7 @@ -843,7 +843,7 @@ unlink TEST_DIR/luks-aes-256-cbc-essiv-sha256-sha1.img # Create image truncate TEST_DIR/luks-aes-256-xts-essiv-sha256-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-essiv:sha256 --key-size = 512 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-= 256-xts-essiv-sha256-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-essiv:sha25= 6 --key-size 512 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_= DIR/luks-aes-256-xts-essiv-sha256-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-essiv-sha256-sha1= .img qiotest-145-aes-256-xts-essiv-sha256-sha1 # Write test pattern 0xa7 @@ -963,7 +963,7 @@ unlink TEST_DIR/luks-aes-256-xts-essiv-sha256-sha1.img # Create image truncate TEST_DIR/luks-aes-128-xts-plain64-sha256-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-plain64 --key-size 256 -= -hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-128-x= ts-plain64-sha256-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain64 --k= ey-size 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/l= uks-aes-128-xts-plain64-sha256-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-128-xts-plain64-sha256-sh= a1.img qiotest-145-aes-128-xts-plain64-sha256-sha1 # Write test pattern 0xa7 @@ -1083,7 +1083,7 @@ unlink TEST_DIR/luks-aes-128-xts-plain64-sha256-sha1.= img # Create image truncate TEST_DIR/luks-aes-192-xts-plain64-sha256-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-plain64 --key-size 384 -= -hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-192-x= ts-plain64-sha256-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain64 --k= ey-size 384 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/l= uks-aes-192-xts-plain64-sha256-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-192-xts-plain64-sha256-sh= a1.img qiotest-145-aes-192-xts-plain64-sha256-sha1 # Write test pattern 0xa7 @@ -1203,7 +1203,7 @@ unlink TEST_DIR/luks-aes-192-xts-plain64-sha256-sha1.= img # Create image truncate TEST_DIR/luks-twofish-128-xts-plain64-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher twofish-xts-plain64 --key-size 2= 56 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-twofi= sh-128-xts-plain64-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher twofish-xts-plain64= --key-size 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_D= IR/luks-twofish-128-xts-plain64-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-twofish-128-xts-plain64-sha1.= img qiotest-145-twofish-128-xts-plain64-sha1 # Write test pattern 0xa7 @@ -1324,7 +1324,7 @@ Skipping twofish-192-xts-plain64-sha1 in blacklist # Create image truncate TEST_DIR/luks-serpent-128-xts-plain64-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher serpent-xts-plain64 --key-size 2= 56 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-serpe= nt-128-xts-plain64-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher serpent-xts-plain64= --key-size 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_D= IR/luks-serpent-128-xts-plain64-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-serpent-128-xts-plain64-sha1.= img qiotest-145-serpent-128-xts-plain64-sha1 # Write test pattern 0xa7 @@ -1444,7 +1444,7 @@ unlink TEST_DIR/luks-serpent-128-xts-plain64-sha1.img # Create image truncate TEST_DIR/luks-serpent-192-xts-plain64-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher serpent-xts-plain64 --key-size 3= 84 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-serpe= nt-192-xts-plain64-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher serpent-xts-plain64= --key-size 384 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_D= IR/luks-serpent-192-xts-plain64-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-serpent-192-xts-plain64-sha1.= img qiotest-145-serpent-192-xts-plain64-sha1 # Write test pattern 0xa7 @@ -1566,7 +1566,7 @@ Skipping cast6-192-xts-plain64-sha1 in blacklist # Create image truncate TEST_DIR/luks-aes-256-xts-plain64-sha224.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-plain64 --key-size 512 -= -hash sha224 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-256= -xts-plain64-sha224.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain64 --k= ey-size 512 --hash sha224 --key-slot 0 --key-file - --iter-time 10 TEST_DIR= /luks-aes-256-xts-plain64-sha224.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-sha224.im= g qiotest-145-aes-256-xts-plain64-sha224 # Write test pattern 0xa7 @@ -1686,7 +1686,7 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-sha224.img # Create image truncate TEST_DIR/luks-aes-256-xts-plain64-sha256.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-plain64 --key-size 512 -= -hash sha256 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-256= -xts-plain64-sha256.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain64 --k= ey-size 512 --hash sha256 --key-slot 0 --key-file - --iter-time 10 TEST_DIR= /luks-aes-256-xts-plain64-sha256.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-sha256.im= g qiotest-145-aes-256-xts-plain64-sha256 # Write test pattern 0xa7 @@ -1806,7 +1806,7 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-sha256.img # Create image truncate TEST_DIR/luks-aes-256-xts-plain64-sha384.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-plain64 --key-size 512 -= -hash sha384 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-256= -xts-plain64-sha384.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain64 --k= ey-size 512 --hash sha384 --key-slot 0 --key-file - --iter-time 10 TEST_DIR= /luks-aes-256-xts-plain64-sha384.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-sha384.im= g qiotest-145-aes-256-xts-plain64-sha384 # Write test pattern 0xa7 @@ -1926,7 +1926,7 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-sha384.img # Create image truncate TEST_DIR/luks-aes-256-xts-plain64-sha512.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-plain64 --key-size 512 -= -hash sha512 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-256= -xts-plain64-sha512.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain64 --k= ey-size 512 --hash sha512 --key-slot 0 --key-file - --iter-time 10 TEST_DIR= /luks-aes-256-xts-plain64-sha512.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-sha512.im= g qiotest-145-aes-256-xts-plain64-sha512 # Write test pattern 0xa7 @@ -2046,7 +2046,7 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-sha512.img # Create image truncate TEST_DIR/luks-aes-256-xts-plain64-ripemd160.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-plain64 --key-size 512 -= -hash ripemd160 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-= 256-xts-plain64-ripemd160.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain64 --k= ey-size 512 --hash ripemd160 --key-slot 0 --key-file - --iter-time 10 TEST_= DIR/luks-aes-256-xts-plain64-ripemd160.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain64-ripemd160= .img qiotest-145-aes-256-xts-plain64-ripemd160 # Write test pattern 0xa7 @@ -2166,7 +2166,7 @@ unlink TEST_DIR/luks-aes-256-xts-plain64-ripemd160.img # Create image truncate TEST_DIR/luks-aes-256-xts-plain-sha1-pwslot3.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-plain --key-size 512 --h= ash sha1 --key-slot 3 --key-file - --iter-time 10 TEST_DIR/luks-aes-256-xts= -plain-sha1-pwslot3.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain --key= -size 512 --hash sha1 --key-slot 3 --key-file - --iter-time 10 TEST_DIR/luk= s-aes-256-xts-plain-sha1-pwslot3.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-xts-plain-sha1-pwslot= 3.img qiotest-145-aes-256-xts-plain-sha1-pwslot3 # Write test pattern 0xa7 @@ -2226,7 +2226,7 @@ unlink TEST_DIR/luks-aes-256-xts-plain-sha1-pwslot3.i= mg # Create image truncate TEST_DIR/luks-aes-256-xts-plain-sha1-pwallslots.img --size 419430= 4MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-xts-plain --key-size 512 --h= ash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-256-xts= -plain-sha1-pwallslots.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-xts-plain --key= -size 512 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luk= s-aes-256-xts-plain-sha1-pwallslots.img # Add password slot 1 sudo cryptsetup -q -v luksAddKey TEST_DIR/luks-aes-256-xts-plain-sha1-pwal= lslots.img --key-slot 1 --key-file - --iter-time 10 TEST_DIR/passwd.txt # Add password slot 2 @@ -2360,7 +2360,7 @@ unlink TEST_DIR/luks-aes-256-xts-plain-sha1-pwallslot= s.img # Create image truncate TEST_DIR/luks-aes-256-cbc-essiv-auto-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-cbc-essiv:sha256 --key-size = 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-aes-= 256-cbc-essiv-auto-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-cbc-essiv:sha25= 6 --key-size 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_= DIR/luks-aes-256-cbc-essiv-auto-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-cbc-essiv-auto-sha1.i= mg qiotest-145-aes-256-cbc-essiv-auto-sha1 # Write test pattern 0xa7 @@ -2480,7 +2480,7 @@ unlink TEST_DIR/luks-aes-256-cbc-essiv-auto-sha1.img # Create image truncate TEST_DIR/luks-aes-256-cbc-plain64-sha256-sha1.img --size 4194304MB # Format image -sudo cryptsetup -q -v luksFormat --cipher aes-cbc-plain64:sha256 --key-siz= e 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TEST_DIR/luks-ae= s-256-cbc-plain64-sha256-sha1.img +sudo cryptsetup -q -v luksFormat --type luks1 --cipher aes-cbc-plain64:sha= 256 --key-size 256 --hash sha1 --key-slot 0 --key-file - --iter-time 10 TES= T_DIR/luks-aes-256-cbc-plain64-sha256-sha1.img # Open dev sudo cryptsetup -q -v luksOpen TEST_DIR/luks-aes-256-cbc-plain64-sha256-sh= a1.img qiotest-145-aes-256-cbc-plain64-sha256-sha1 # Write test pattern 0xa7 --=20 2.21.0 From nobody Fri Apr 26 07:02:52 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=1570710001; cv=none; d=zoho.com; s=zohoarc; b=Dfba/Ar8m1znsgKL0zFxAjQ9E8nFx2dsABEpBYvrrKu7/eeQfSfkm4KKbwoGrGzhdmYvOw+nUboZ/LIypFItFUjLSVt1xBkuljgAMt5U4iv8ThFVulB1hLdH/1IUQF3VZHsRHYFBb0zJNc8HgULn6B+9ksjCMZqpLVKi/pTuHvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570710001; 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; bh=E+bACUCH67U1Z8Gie9MUlJFIjmYKPq5Z2mQOmL2Hln8=; b=jxE7UFgnpVyi203XXOOIjGetzhKE6WR3znIQs248954qxkhi0XLIqE05mGxS4Z0+/S2stnDL7YOvxOjLzROV9x17AVOozUnkHVtOiDuD8+XaUIjSfShoxDXKax3+Nyigg6MRT6LUzBKIuJ2dDQ04uvfQ5UrmKmy05JqL0svYiyo= 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 157071000115393.71809715821507; Thu, 10 Oct 2019 05:20:01 -0700 (PDT) Received: from localhost ([::1]:37058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIXQA-00055R-RQ for importer@patchew.org; Thu, 10 Oct 2019 08:19:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52410) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIWru-0007Sz-RP for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIWrs-00006k-PS for qemu-devel@nongnu.org; Thu, 10 Oct 2019 07:44:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56056) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIWro-0008UM-LV; Thu, 10 Oct 2019 07:44:24 -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 2909B87638; Thu, 10 Oct 2019 11:44:22 +0000 (UTC) Received: from localhost (unknown [10.36.118.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C26FE5C553; Thu, 10 Oct 2019 11:44:21 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 36/36] iotests/162: Fix for newer Linux 5.3+ Date: Thu, 10 Oct 2019 13:43:00 +0200 Message-Id: <20191010114300.7746-37-mreitz@redhat.com> In-Reply-To: <20191010114300.7746-1-mreitz@redhat.com> References: <20191010114300.7746-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.26]); Thu, 10 Oct 2019 11:44:22 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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" Linux 5.3 has made 0.0.0.0/8 a working IPv4 subnet. As such, "42" is now a valid host, and the connection to it will (hopefully) time out over a long period rather than quickly return with EINVAL. So let us use a negative integer for testing that NBD will not crash when it receives integer hosts. This way, the connection will again fail quickly and reliably. Signed-off-by: Max Reitz Message-id: 20191002174052.5773-1-mreitz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- tests/qemu-iotests/162 | 2 +- tests/qemu-iotests/162.out | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/162 b/tests/qemu-iotests/162 index 2d719afbed..c0053ed975 100755 --- a/tests/qemu-iotests/162 +++ b/tests/qemu-iotests/162 @@ -46,7 +46,7 @@ echo '=3D=3D=3D NBD =3D=3D=3D' # NBD expects all of its arguments to be strings =20 # So this should not crash -$QEMU_IMG info 'json:{"driver": "nbd", "host": 42}' +$QEMU_IMG info 'json:{"driver": "nbd", "host": -1}' =20 # And this should not treat @port as if it had not been specified # (We need to set up a server here, because the error message for "Connect= ion diff --git a/tests/qemu-iotests/162.out b/tests/qemu-iotests/162.out index 3c5be2c569..5a00d36d17 100644 --- a/tests/qemu-iotests/162.out +++ b/tests/qemu-iotests/162.out @@ -1,7 +1,7 @@ QA output created by 162 =20 =3D=3D=3D NBD =3D=3D=3D -qemu-img: Could not open 'json:{"driver": "nbd", "host": 42}': Failed to c= onnect socket: Invalid argument +qemu-img: Could not open 'json:{"driver": "nbd", "host": -1}': address res= olution failed for -1:10809: Name or service not known image: nbd://localhost:PORT image: nbd+unix://?socket=3D42 =20 --=20 2.21.0