[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.11] qcow2: fix image corruption on commit
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH for-2.11] qcow2: fix image corruption on commit with persistent snapshot |
Date: |
Fri, 17 Nov 2017 11:11:51 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 11/17/2017 11:07 AM, Vladimir Sementsov-Ogievskiy wrote:
> 17.11.2017 19:47, Eric Blake wrote:
>> If an image contains persistent snapshots, we cannot use the
>
> bitmaps
Oh, right. Maintainer can fix that, if I don't need to respin.
>
>> fast path of bdrv_make_empty() to clear the image during
>> qemu-img commit, because that will lose the clusters related
>> to the bitmaps.
>>
>> Also leave a comment in qcow2_read_extensions to remind future
>> feature additions to think about fast-path removal, since we
>> just barely fixed the same bug for LUKS encryption.
>>
>> It's a pain that qemu-img has not yet been taught to manipulate,
>> or even at a very minimum display, information about persistent
>> bitmaps; instead, we have to use QMP commands. It's also a
>> pain that only qeury-block and x-debug-block-dirty-bitmap-sha256
>> will allow bitmap introspection; but the former requires the
>> node to be hooked to a block device, and the latter is experimental.
>
> sorry for that pain =(.
>
> Honestly, I don't understand why such a simple and obvious fix needs an
> additional test.
Because the test was cool! Here's how it fails without the qcow2 fix:
--- /home/eblake/qemu/tests/qemu-iotests/176.out 2017-11-17
10:41:56.287187401 -0600
+++ /home/eblake/qemu/tests/qemu-iotests/176.out.bad 2017-11-17
10:42:07.621220260 -0600
@@ -179,6 +179,8 @@
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 512/512 bytes at offset 2202009600
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+qemu-img: Bitmap '' doesn't satisfy the constraints
+qemu-img: Persistent bitmaps are lost for node '#block148'
Image committed.
read 196608/196608 bytes at offset 2147287040
192 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@@ -198,14 +200,11 @@
0x7ffd0000 0x10000 TEST_DIR/t.IMGFMT.base
0x7ffe0000 0x20000 TEST_DIR/t.IMGFMT.itmd
0x83400000 0x200 TEST_DIR/t.IMGFMT.itmd
-Offset Length File
-0x7ffd0000 0x10000 TEST_DIR/t.IMGFMT.base
-0x7ffe0000 0x20000 TEST_DIR/t.IMGFMT.itmd
-0x83400000 0x200 TEST_DIR/t.IMGFMT.itmd
+qemu-img: Could not open
'/home/eblake/qemu/tests/qemu-iotests/scratch/t.qcow2': Bitmap ''
doesn't satisfy the constraints
QMP_VERSION
{"return": {}}
-{"return": {}}
-{"return": {"sha256":
"e12600978d86b5a453861ae5c17d275204673fef3874b7c3c5433c6153d84706"}}
+{"error": {"class": "GenericError", "desc": "Bitmap '' doesn't satisfy
the constraints"}}
+{"error": {"class": "GenericError", "desc": "Node 'drive0' not found"}}
{"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
"event": "SHUTDOWN", "data": {"guest": false}}
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature