On 04/28/2017 04:24 PM, Eric Blake wrote: >>> +echo >>> +echo == unaligned image tail cluster, no allocation needed == >>> + >>> +CLUSTER_SIZE=1024 TEST_IMG="$TEST_IMG.base" _make_test_img $((size + 1024)) >> >> Any reason for the CLUSTER_SIZE? It passes with 64 kB as well, and I >> actually think that would be a better test because as it is, the image's >> "unaligned" tail is exactly one cluster (so it isn't really unaligned). > > Uhhh - copy-and-paste? You're right, that 1024 is too small for what > I'm actually doing with it. :(
Actually, the whole test defaults to 4k clusters except when overridden, but I did learn while hammering at things that we don't have a nice way to tell that a backing file slightly shorter than the active file behaves as though we read all zeros for the difference. I'm thinking of proposing an RFC patch introducing BDRV_BLOCK_EOF, which gets set any time bdrv_get_block_status() clamps the returns *pnum because it hit EOF, to see what optimizations fall out elsewhere in the tree as a result. (It may not be worth it in the end, but we'll see). -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature