From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, kwolf@redhat.com, Max Reitz <mreitz@redhat.com>
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 [thread overview]
Message-ID: <e42602d2-3b4a-279d-4714-2d281f879d41@redhat.com> (raw)
In-Reply-To: <600d87a3-93a9-5d5d-7a9f-a31ba213348b@virtuozzo.com>
[-- Attachment #1: Type: text/plain, Size: 2919 bytes --]
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2017-11-17 17:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-17 16:47 [Qemu-devel] [PATCH for-2.11] qcow2: fix image corruption on commit with persistent snapshot Eric Blake
2017-11-17 17:07 ` Vladimir Sementsov-Ogievskiy
2017-11-17 17:11 ` Eric Blake [this message]
2017-11-17 17:24 ` Kevin Wolf
2017-11-17 17:19 ` Kevin Wolf
2017-11-17 18:17 ` Max Reitz
2017-11-17 18:46 ` Eric Blake
2017-11-17 18:55 ` Eric Blake
2017-11-20 14:36 ` Kevin Wolf
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=e42602d2-3b4a-279d-4714-2d281f879d41@redhat.com \
--to=eblake@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).