[Top][All Lists]

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

Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: Reset free_cluster_index wh

From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] qcow2: Reset free_cluster_index when allocating a new refcount block
Date: Wed, 21 Mar 2018 08:31:37 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 03/21/2018 08:30 AM, Eric Blake wrote:
On 03/20/2018 08:55 AM, Alberto Garcia wrote:

This can be reproduced easily:

      qemu-img create -f qcow2 -o cluster_size=512 hd.qcow2 1M
      qemu-io -c 'write 0 124k' hd.qcow2

This reproduction fails if you use non-default refcount_order...

+++ b/tests/qemu-iotests/121
@@ -93,6 +93,26 @@ $QEMU_IO -c 'write 63M 130K' "$TEST_IMG" | _filter_qemu_io
+echo '=== Allocating a new refcount block must not leave holes in the image ==='
+IMGOPTS='cluster_size=512' _make_test_img 1M

...so here, I think IMGOPTS also has to include refcount_bits=4, so that calling iotests './check -o refcount_bits=3' or similar doesn't fail the test.

Except that it's spelled refcount_bits=16 vs. refcount_bits=8 (we convert refcount_bits as a power of 2 to refcount_order as an exponent value written into the qcow2 header).

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

reply via email to

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