aboutsummaryrefslogtreecommitdiff
path: root/block/io.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-09-25 09:55:24 -0500
committerKevin Wolf <kwolf@redhat.com>2017-10-06 16:28:58 +0200
commit49d741b5041b79214db58f364cebe2f367517711 (patch)
treeed74cc93cfcbf73fc4e9044ba9c48f883315b388 /block/io.c
parentab94db6f7609e562b5f68cc71807d5d50e24e224 (diff)
downloadqemu-49d741b5041b79214db58f364cebe2f367517711.zip
qemu-49d741b5041b79214db58f364cebe2f367517711.tar.gz
qemu-49d741b5041b79214db58f364cebe2f367517711.tar.bz2
qcow2: Switch store_bitmap_data() to byte-based iteration
Now that we have adjusted the majority of the calls this function makes to be byte-based, it is easier to read the code if it makes passes over the image using bytes rather than sectors. iotests 165 was rather weak - on a default 64k-cluster image, where bitmap granularity also defaults to 64k bytes, a single cluster of the bitmap table thus covers (64*1024*8) bits which each cover 64k bytes, or 32G of image space. But the test only uses a 1G image, so it cannot trigger any more than one loop of the code in store_bitmap_data(); and it was writing to the first cluster. In order to test that we are properly aligning which portions of the bitmap are being written to the file, we really want to test a case where the first dirty bit returned by bdrv_dirty_iter_next() is not aligned to the start of a cluster, which we can do by modifying the test to write data that doesn't happen to fall in the first cluster of the image. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/io.c')
0 files changed, 0 insertions, 0 deletions