qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, nsoffer@redhat.com, qemu-block@nongnu.org,
	John Snow <jsnow@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH 1/2] iotests: Improve and rename test 291 to qemu-img-bitmap
Date: Fri, 9 Jul 2021 16:49:01 +0300	[thread overview]
Message-ID: <37cad204-ccb7-454e-b91c-83be04c38167@virtuozzo.com> (raw)
In-Reply-To: <20210709131650.atmnvid6376msxpz@redhat.com>

09.07.2021 16:16, Eric Blake wrote:
> On Fri, Jul 09, 2021 at 09:33:50AM +0300, Vladimir Sementsov-Ogievskiy wrote:
>>> +++ b/tests/qemu-iotests/tests/qemu-img-bitmaps
> 
>>> +echo
>>> +echo "=== Check handling of inconsistent bitmap ==="
>>> +echo
>>> +
>>> +$QEMU_IO -c abort "$TEST_IMG" 2>/dev/null
>>> +$QEMU_IMG bitmap --add "$TEST_IMG" b4
>>> +$QEMU_IMG bitmap --remove "$TEST_IMG" b1
>>> +_img_info --format-specific | _filter_irrelevant_img_info
>>> +$QEMU_IMG convert --bitmaps -O qcow2 "$TEST_IMG" "$TEST_IMG.copy"
>>
>> Worth then removing remaining inconsistent bitmaps and try again?
>>
>> I think you should now remove $TEST_IMG.copy in _cleanup
> 
> $TEST_IMG.copy isn't created on failure (or if it is, that in itself
> is a problem we should be avoiding),

Seems that's the case:
./build/qemu-img create -f qcow2 x 1M
./build/qemu-img bitmap --add x b1
./build/qemu-io x
qemu-io> abort
Aborted (core dumped)
  ./build/qemu-img info x
image: x
file format: qcow2
virtual size: 1 MiB (1048576 bytes)
disk size: 204 KiB
cluster_size: 65536
Format specific information:
     compat: 1.1
     compression type: zlib
     lazy refcounts: false
     bitmaps:
         [0]:
             flags:
                 [0]: in-use
                 [1]: auto
             name: b1
             granularity: 65536
     refcount bits: 16
     corrupt: false
     extended l2: false


ls y
ls: cannot access 'y': No such file or directory
./build/qemu-img convert --bitmaps -O qcow2 x y
qemu-img: Failed to populate bitmap b1: Bitmap 'b1' is inconsistent and cannot be used
Try block-dirty-bitmap-remove to delete this bitmap from disk[root@kvm master]#
# ls y
y
./build/qemu-img info y
image: y
file format: qcow2
virtual size: 1 MiB (1048576 bytes)
disk size: 204 KiB
cluster_size: 65536
Format specific information:
     compat: 1.1
     compression type: zlib
     lazy refcounts: false
     bitmaps:
         [0]:
             flags:
             name: b1
             granularity: 65536
     refcount bits: 16
     corrupt: false
     extended l2: false


WOW! It even contains the bitmap not marked in-use. That's a real bug.

> so as written, there was nothing
> that should have needed cleaning up until patch 2.  But your idea
> (here and in patch 2) of demonstrating manual cleanup for recovery (in
> addition to the goal of patch 2 of skipping broken bitmaps in the
> first place) is reasonable, so I'll incorporate that into v2.
> 


-- 
Best regards,
Vladimir


  reply	other threads:[~2021-07-09 13:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08  1:29 [PATCH 0/2] Let 'qemu-img convert --bitmaps' skip inconsistent bitmaps Eric Blake
2021-07-08  1:30 ` [PATCH 1/2] iotests: Improve and rename test 291 to qemu-img-bitmap Eric Blake
2021-07-09  6:33   ` Vladimir Sementsov-Ogievskiy
2021-07-09 13:16     ` Eric Blake
2021-07-09 13:49       ` Vladimir Sementsov-Ogievskiy [this message]
2021-07-09 14:17         ` Eric Blake
2021-07-08  1:30 ` [PATCH 2/2] qemu-img: Add --skip-broken for 'convert --bitmaps' Eric Blake
2021-07-09  6:54   ` Vladimir Sementsov-Ogievskiy
2021-07-09  9:50 ` [PATCH 0/2] Let 'qemu-img convert --bitmaps' skip inconsistent bitmaps 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=37cad204-ccb7-454e-b91c-83be04c38167@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=nsoffer@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).