All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, vsementsov@virtuozzo.com,
	qemu-devel@nongnu.org, mreitz@redhat.com,
	andrey.shinkevich@virtuozzo.com, den@openvz.org
Subject: [PATCH v12 11/11] iotests: dump QCOW2 header in JSON in #303
Date: Thu, 30 Jul 2020 17:15:12 +0300	[thread overview]
Message-ID: <1596118512-424960-12-git-send-email-andrey.shinkevich@virtuozzo.com> (raw)
In-Reply-To: <1596118512-424960-1-git-send-email-andrey.shinkevich@virtuozzo.com>

Extend the test case #303 by dumping QCOW2 image metadata in JSON
format.

Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
---
 tests/qemu-iotests/303     |  3 ++
 tests/qemu-iotests/303.out | 76 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)

diff --git a/tests/qemu-iotests/303 b/tests/qemu-iotests/303
index 3c7a611..6821bd3 100755
--- a/tests/qemu-iotests/303
+++ b/tests/qemu-iotests/303
@@ -57,3 +57,6 @@ add_bitmap(1, 1, 7, False)
 add_bitmap(2, 7, 9, True)
 dump = ['qcow2.py', f'{disk}', 'dump-header']
 subprocess.run(dump)
+# Dump the metadata in JSON format
+dump.append('-j')
+subprocess.run(dump)
diff --git a/tests/qemu-iotests/303.out b/tests/qemu-iotests/303.out
index d581fb4..ead3b63 100644
--- a/tests/qemu-iotests/303.out
+++ b/tests/qemu-iotests/303.out
@@ -84,3 +84,79 @@ extra_data_size           0
 Bitmap table   type            size         offset
 0              all-zeroes      65536        0
 
+{
+    "magic": 1363560955,
+    "version": 3,
+    "backing_file_offset": 0,
+    "backing_file_size": 0,
+    "cluster_bits": 16,
+    "size": 10485760,
+    "crypt_method": 0,
+    "l1_size": 1,
+    "l1_table_offset": 196608,
+    "refcount_table_offset": 65536,
+    "refcount_table_clusters": 1,
+    "nb_snapshots": 0,
+    "snapshot_offset": 0,
+    "incompatible_features": 0,
+    "compatible_features": 0,
+    "autoclear_features": 1,
+    "refcount_order": 4,
+    "header_length": 112
+}
+
+[
+    {
+        "name": "Feature table",
+        "magic": 1745090647,
+        "length": 336,
+        "data_str": "<binary>"
+    },
+    {
+        "name": "Bitmaps",
+        "magic": 595929205,
+        "length": 24,
+        "data": {
+            "nb_bitmaps": 2,
+            "reserved32": 0,
+            "bitmap_directory_size": 64,
+            "bitmap_directory_offset": 10289152,
+            "bitmap_directory": [
+                {
+                    "name": "bitmap-1",
+                    "bitmap_table_offset": 10158080,
+                    "bitmap_table_size": 1,
+                    "flags": 2,
+                    "type": 1,
+                    "granularity_bits": 15,
+                    "name_size": 8,
+                    "extra_data_size": 0,
+                    "bitmap_table": [
+                        {
+                            "type": "serialized",
+                            "offset": 10092544,
+                            "reserved": 0
+                        }
+                    ]
+                },
+                {
+                    "name": "bitmap-2",
+                    "bitmap_table_offset": 10223616,
+                    "bitmap_table_size": 1,
+                    "flags": 0,
+                    "type": 1,
+                    "granularity_bits": 16,
+                    "name_size": 8,
+                    "extra_data_size": 0,
+                    "bitmap_table": [
+                        {
+                            "type": "all-zeroes",
+                            "offset": 0,
+                            "reserved": 0
+                        }
+                    ]
+                }
+            ]
+        }
+    }
+]
-- 
1.8.3.1



  parent reply	other threads:[~2020-07-30 14:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30 14:15 [PATCH v12 00/11] iotests: Dump QCOW2 dirty bitmaps metadata Andrey Shinkevich
2020-07-30 14:15 ` [PATCH v12 01/11] iotests: add test for QCOW2 header dump Andrey Shinkevich
2020-07-30 19:05   ` Eric Blake
2020-07-31  7:28     ` Andrey Shinkevich
2020-08-05 11:23   ` Vladimir Sementsov-Ogievskiy
2020-08-05 12:10     ` Andrey Shinkevich
2020-07-30 14:15 ` [PATCH v12 02/11] qcow2_format.py: make printable data an extension class member Andrey Shinkevich
2020-07-30 14:15 ` [PATCH v12 03/11] qcow2_format.py: change Qcow2BitmapExt initialization method Andrey Shinkevich
2020-07-30 14:15 ` [PATCH v12 04/11] qcow2_format.py: dump bitmap flags in human readable way Andrey Shinkevich
2020-07-30 14:15 ` [PATCH v12 05/11] qcow2_format.py: Dump bitmap directory information Andrey Shinkevich
2020-07-30 14:15 ` [PATCH v12 06/11] qcow2_format.py: pass cluster size to substructures Andrey Shinkevich
2020-07-30 14:15 ` [PATCH v12 07/11] qcow2_format.py: Dump bitmap table serialized entries Andrey Shinkevich
2020-08-05 15:57   ` Vladimir Sementsov-Ogievskiy
2020-07-30 14:15 ` [PATCH v12 08/11] qcow2.py: Introduce '-j' key to dump in JSON format Andrey Shinkevich
2020-08-05 16:12   ` Vladimir Sementsov-Ogievskiy
2020-07-30 14:15 ` [PATCH v12 09/11] qcow2_format.py: collect fields " Andrey Shinkevich
2020-08-05 16:58   ` Vladimir Sementsov-Ogievskiy
2020-08-06  9:08     ` Andrey Shinkevich
2020-08-06  9:18       ` Vladimir Sementsov-Ogievskiy
2020-07-30 14:15 ` [PATCH v12 10/11] qcow2_format.py: support dumping metadata " Andrey Shinkevich
2020-08-05 17:04   ` Vladimir Sementsov-Ogievskiy
2020-07-30 14:15 ` Andrey Shinkevich [this message]
2020-08-05 17:08   ` [PATCH v12 11/11] iotests: dump QCOW2 header in JSON in #303 Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1596118512-424960-12-git-send-email-andrey.shinkevich@virtuozzo.com \
    --to=andrey.shinkevich@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.