qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v12 01/11] iotests: add test for QCOW2 header dump


From: Andrey Shinkevich
Subject: Re: [PATCH v12 01/11] iotests: add test for QCOW2 header dump
Date: Fri, 31 Jul 2020 10:28:57 +0300
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 30.07.2020 22:05, Eric Blake wrote:
On 7/30/20 9:15 AM, Andrey Shinkevich wrote:
The simple script creates a QCOW2 image and fills it with some data.
Two bitmaps are created as well. Then the script reads the image header
with extensions from the disk by running the script qcow2.py and dumps
the information to the output. Other entities, such as snapshots, may
be added to the test later.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
---
  tests/qemu-iotests/303     | 59 ++++++++++++++++++++++++++++++++++++++++++   tests/qemu-iotests/303.out | 64 ++++++++++++++++++++++++++++++++++++++++++++++
  tests/qemu-iotests/group   |  1 +
  3 files changed, 124 insertions(+)
  create mode 100755 tests/qemu-iotests/303
  create mode 100644 tests/qemu-iotests/303.out

+import iotests
+import subprocess
+from iotests import qemu_img_create, qemu_io, file_path, log, filter_qemu_io
+
+iotests.script_initialize(supported_fmts=['qcow2'])
+
+disk = file_path('disk')
+chunk = 1024 * 1024
+
+
+def create_bitmap(bitmap_number, disabled):
+    granularity = 1 << (14 + bitmap_number)
+    bitmap_name = 'bitmap-' + str(bitmap_number)
+    vm = iotests.VM().add_drive(disk)
+    vm.launch()
+    vm.qmp_log('block-dirty-bitmap-add', node='drive0', name=bitmap_name, +               granularity=granularity, persistent=True, disabled=disabled)
+    vm.shutdown()

Would it be any easier to use qemu-img bitmap here instead of firing up a full VM?


I agree, you are right. I'll take it into account for the next version, if any.

Thank you for your R-b.

Andrey



At any rate, this is a nice starting point for tracking what the rest of your series improves.

Reviewed-by: Eric Blake <eblake@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]