aboutsummaryrefslogtreecommitdiff
path: root/include/block/block_int.h
diff options
context:
space:
mode:
authorAsias He <asias@redhat.com>2013-08-22 15:24:14 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2013-08-22 14:10:21 +0200
commit0d51b4debee6fb322751a57097a1d675c7a7c38d (patch)
treeb72339a0fbb9c363436a9e625e01250204e3dc15 /include/block/block_int.h
parent8ad1898cf1f5314731123afce057e5cf74fd2f01 (diff)
downloadqemu-0d51b4debee6fb322751a57097a1d675c7a7c38d.zip
qemu-0d51b4debee6fb322751a57097a1d675c7a7c38d.tar.gz
qemu-0d51b4debee6fb322751a57097a1d675c7a7c38d.tar.bz2
block: Introduce bs->zero_beyond_eof
In 4146b46c42e0989cb5842e04d88ab6ccb1713a48 (block: Produce zeros when protocols reading beyond end of file), we break qemu-iotests ./check -qcow2 022. This happens because qcow2 temporarily sets ->growable = 1 for vmstate accesses (which are stored beyond the end of regular image data). We introduce the bs->zero_beyond_eof to allow qcow2_load_vmstate() to disable ->zero_beyond_eof temporarily in addition to enable ->growable. [Since the broken patch "block: Produce zeros when protocols reading beyond end of file" has not been merged yet, I have applied this fix *first* and will then apply the next patch to keep the tree bisectable. -- Stefan] Suggested-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Asias He <asias@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/block/block_int.h')
-rw-r--r--include/block/block_int.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h
index e45f2a0..74b0689 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -281,6 +281,9 @@ struct BlockDriverState {
/* Whether the disk can expand beyond total_sectors */
int growable;
+ /* Whether produces zeros when read beyond eof */
+ bool zero_beyond_eof;
+
/* the memory alignment required for the buffers handled by this driver */
int buffer_alignment;