From nobody Tue Feb 10 01:35:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1591019660; cv=none; d=zohomail.com; s=zohoarc; b=NfnrGLUKTdZ/razRjX0TFBXqhTx4tgiqURu2LZIZRWTsW28aD0HOU7KJnC8CfrcDoNlMqODy7GfcD10FSylgDUCBMLZNAcsyzw4sUS8fVGk27q2vXWhCVglaQYlnDPaTzEGH+bi03Tf6EIVqsOkLEPVWo8MH61uzUzVNaWMrteU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591019660; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=12W4lJ3LUJMvYATH0U8FIIhVlEdKwXqMy0XkAP/1dA4=; b=Rn5Z4yEsJrNdlNOrMGv6sOpMK6MjFeMXydcWoZpb0bvrCik0GKJ1pCjWz5/aexA32MIMI5wM67Nj6YUzhD7oTDc3v1OEkrON70PBMCUdQ1kHcTWTZRg+PeYoJ7UW+3G7UjENCi6X+qxmtRv+KvjfmRGW9XdqeCFfXP591Lk5f/c= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; 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 1591019660187929.2201737679019; Mon, 1 Jun 2020 06:54:20 -0700 (PDT) Received: from localhost ([::1]:37260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfktO-00033D-O3 for importer@patchew.org; Mon, 01 Jun 2020 09:54:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfkne-0003od-8L; Mon, 01 Jun 2020 09:48:22 -0400 Received: from relay.sw.ru ([185.231.240.75]:38772 helo=relay3.sw.ru) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfknc-0001k9-1H; Mon, 01 Jun 2020 09:48:21 -0400 Received: from [172.16.25.136] (helo=localhost.sw.ru) by relay3.sw.ru with esmtp (Exim 4.93) (envelope-from ) id 1jfknN-0005dY-KW; Mon, 01 Jun 2020 16:48:05 +0300 From: Andrey Shinkevich To: qemu-block@nongnu.org Subject: [PATCH v3 1/6] iotests: Add extension names to qcow2.py dump Date: Mon, 1 Jun 2020 16:48:08 +0300 Message-Id: <1591019293-211155-2-git-send-email-andrey.shinkevich@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1591019293-211155-1-git-send-email-andrey.shinkevich@virtuozzo.com> References: <1591019293-211155-1-git-send-email-andrey.shinkevich@virtuozzo.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=185.231.240.75; envelope-from=andrey.shinkevich@virtuozzo.com; helo=relay3.sw.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/01 09:48:16 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, qemu-devel@nongnu.org, mreitz@redhat.com, andrey.shinkevich@virtuozzo.com, den@openvz.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Header extension: Feature table magic 0x6803f857 length 192 data The change incurs modification of the output in 031, 036 and 061 test cases. Signed-off-by: Andrey Shinkevich Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/031.out | 22 +++++++++++----------- tests/qemu-iotests/036.out | 4 ++-- tests/qemu-iotests/061.out | 18 +++++++++--------- tests/qemu-iotests/qcow2.py | 23 ++++++++++++++++++++--- 4 files changed, 42 insertions(+), 25 deletions(-) diff --git a/tests/qemu-iotests/031.out b/tests/qemu-iotests/031.out index 5a4beda..966c8d9 100644 --- a/tests/qemu-iotests/031.out +++ b/tests/qemu-iotests/031.out @@ -24,7 +24,7 @@ autoclear_features [] refcount_order 4 header_length 72 =20 -Header extension: +Header extension: Unknown magic 0x12345678 length 31 data 'This is a test header extension' @@ -52,7 +52,7 @@ autoclear_features [] refcount_order 4 header_length 72 =20 -Header extension: +Header extension: Unknown magic 0x12345678 length 31 data 'This is a test header extension' @@ -80,12 +80,12 @@ autoclear_features [] refcount_order 4 header_length 72 =20 -Header extension: +Header extension: Backing format magic 0xe2792aca length 11 data 'host_device' =20 -Header extension: +Header extension: Unknown magic 0x12345678 length 31 data 'This is a test header extension' @@ -115,12 +115,12 @@ autoclear_features [] refcount_order 4 header_length 112 =20 -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data =20 -Header extension: +Header extension: Unknown magic 0x12345678 length 31 data 'This is a test header extension' @@ -148,12 +148,12 @@ autoclear_features [] refcount_order 4 header_length 112 =20 -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data =20 -Header extension: +Header extension: Unknown magic 0x12345678 length 31 data 'This is a test header extension' @@ -181,17 +181,17 @@ autoclear_features [] refcount_order 4 header_length 112 =20 -Header extension: +Header extension: Backing format magic 0xe2792aca length 11 data 'host_device' =20 -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data =20 -Header extension: +Header extension: Unknown magic 0x12345678 length 31 data 'This is a test header extension' diff --git a/tests/qemu-iotests/036.out b/tests/qemu-iotests/036.out index e409acf..81a7366 100644 --- a/tests/qemu-iotests/036.out +++ b/tests/qemu-iotests/036.out @@ -24,7 +24,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108= 864 incompatible_features [] compatible_features [] autoclear_features [63] -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data @@ -36,7 +36,7 @@ No errors were found on the image. incompatible_features [] compatible_features [] autoclear_features [] -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out index a51ad1b..7821b7f 100644 --- a/tests/qemu-iotests/061.out +++ b/tests/qemu-iotests/061.out @@ -24,7 +24,7 @@ autoclear_features [] refcount_order 4 header_length 112 =20 -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data @@ -82,7 +82,7 @@ autoclear_features [] refcount_order 4 header_length 112 =20 -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data @@ -138,7 +138,7 @@ autoclear_features [] refcount_order 4 header_length 112 =20 -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data @@ -193,7 +193,7 @@ autoclear_features [42] refcount_order 4 header_length 112 =20 -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data @@ -262,7 +262,7 @@ autoclear_features [] refcount_order 4 header_length 112 =20 -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data @@ -324,7 +324,7 @@ autoclear_features [] refcount_order 4 header_length 112 =20 -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data @@ -353,7 +353,7 @@ autoclear_features [] refcount_order 4 header_length 112 =20 -Header extension: +Header extension: Feature table magic 0x6803f857 length 336 data @@ -491,7 +491,7 @@ wrote 65536/65536 bytes at offset 2147483648 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 65536/65536 bytes at offset 3221225472 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) - (0.00/100%) (12.50/100%) (25.00/100%) (37.50/100%) (50.00/100%) (62.50/100%) (75.00/100%) (87.50/100%) (100.00/100%) (100.00/100%) + (0.00/100%) (12.50/100%) (25.00/100%) (37.50/100%) (50.00/= 100%) (62.50/100%) (75.00/100%) (87.50/100%) (100.00/100%) (= 100.00/100%) No errors were found on the image. =20 =3D=3D=3D Testing progress report with snapshot =3D=3D=3D @@ -506,7 +506,7 @@ wrote 65536/65536 bytes at offset 2147483648 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 65536/65536 bytes at offset 3221225472 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) - (0.00/100%) (6.25/100%) (12.50/100%) (18.75/100%) (25.00/100%) (31.25/100%) (37.50/100%) (43.75/100%) (50.00/100%) (56.25/100%) (62.50/100%) (68.75/100%) (75.00/100%) (81.25/100%) (87.50/100%) (93.75/100%) (100.00/100%) (100.00/100%) + (0.00/100%) (6.25/100%) (12.50/100%) (18.75/100%) (25.00/1= 00%) (31.25/100%) (37.50/100%) (43.75/100%) (50.00/100%) (56= .25/100%) (62.50/100%) (68.75/100%) (75.00/100%) (81.25/100%) = (87.50/100%) (93.75/100%) (100.00/100%) (100.00/100%) No errors were found on the image. =20 =3D=3D=3D Testing version downgrade with external data file =3D=3D=3D diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py index 94a07b2..e824b09 100755 --- a/tests/qemu-iotests/qcow2.py +++ b/tests/qemu-iotests/qcow2.py @@ -6,19 +6,36 @@ import string =20 class QcowHeaderExtension: =20 + QCOW2_EXT_MAGIC_BACKING_FORMAT =3D 0xE2792ACA + QCOW2_EXT_MAGIC_FEATURE_TABLE =3D 0x6803f857 + QCOW2_EXT_MAGIC_CRYPTO_HEADER =3D 0x0537be77 + QCOW2_EXT_MAGIC_BITMAPS =3D 0x23852875 + QCOW2_EXT_MAGIC_DATA_FILE =3D 0x44415441 + def __init__(self, magic, length, data): if length % 8 !=3D 0: padding =3D 8 - (length % 8) data +=3D b"\0" * padding =20 - self.magic =3D magic + self.magic =3D magic self.length =3D length - self.data =3D data + self.data =3D data + self.name =3D self.extension_name(magic) =20 @classmethod def create(cls, magic, data): return QcowHeaderExtension(magic, len(data), data) =20 + def extension_name(self, magic): + return { + self.QCOW2_EXT_MAGIC_BACKING_FORMAT: 'Backing format', + self.QCOW2_EXT_MAGIC_FEATURE_TABLE: 'Feature table', + self.QCOW2_EXT_MAGIC_CRYPTO_HEADER: 'Crypto header', + self.QCOW2_EXT_MAGIC_BITMAPS: 'Bitmaps', + self.QCOW2_EXT_MAGIC_DATA_FILE: 'Data file', + }.get(magic, 'Unknown') + + class QcowHeader: =20 uint32_t =3D 'I' @@ -151,7 +168,7 @@ class QcowHeader: else: data =3D "" =20 - print("Header extension:") + print("%-25s %s" % ("Header extension:", ex.name)) print("%-25s %#x" % ("magic", ex.magic)) print("%-25s %d" % ("length", ex.length)) print("%-25s %s" % ("data", data)) --=20 1.8.3.1