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
  _check_test_img
+echo
+echo '=== Allocating a new refcount block must not leave holes in the image ==='
+echo
+
+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