diff options
author | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | 2012-08-28 15:26:48 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-08-29 15:23:35 +0200 |
commit | 571cd9dcc7f2fee59e47913365ced7781f33c2d3 (patch) | |
tree | 525bfcaecefe0ff548ff8fd94ea1ad0ccdf5cc34 /target-cris | |
parent | ef72f76e58107bd4096018c3db2912d28249308e (diff) |
stream: complete early if end of backing file is reached
It is possible to create an image that is larger than its backing file.
Reading beyond the end of the backing file produces zeroes if no writes
have been made to those sectors in the image file.
This patch finishes streaming early when the end of the backing file is
reached. Without this patch the block job hangs and continually tries
to stream the first sectors beyond the end of the backing file.
To reproduce the hung block job bug:
$ qemu-img create -f qcow2 backing.qcow2 128M
$ qemu-img create -f qcow2 -o backing_file=backing.qcow2 image.qcow2 6G
$ qemu -drive if=virtio,cache=none,file=image.qcow2
(qemu) block_stream virtio0
(qemu) info block-jobs
The qemu-iotests 030 streaming test still passes.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'target-cris')
0 files changed, 0 insertions, 0 deletions