aboutsummaryrefslogtreecommitdiff
path: root/block/stream.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-08-31 10:04:18 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-31 10:04:18 -0500
commitcdedd9d867f2e955e022f07808b10a4a5d383841 (patch)
tree8f27b6ac02b9eb565d477cb7144ea280e01b4135 /block/stream.c
parentb834b5081d6266cc0789454905f3b7d622d4d096 (diff)
parent774a8850d708aeb6dd6de493c28b374098c1a4c3 (diff)
downloadqemu-arm-cdedd9d867f2e955e022f07808b10a4a5d383841.tar.gz
Merge remote-tracking branch 'kwolf/for-anthony' into staging
* kwolf/for-anthony: qemu-iotests: add backing file smaller than image test case stream: complete early if end of backing file is reached qed: refuse unaligned zero writes with a backing file
Diffstat (limited to 'block/stream.c')
-rw-r--r--block/stream.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/block/stream.c b/block/stream.c
index 37c46525d2..c4f87dd5b6 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -122,6 +122,12 @@ wait:
* known-unallocated area [sector_num, sector_num+n). */
ret = bdrv_co_is_allocated_above(bs->backing_hd, base,
sector_num, n, &n);
+
+ /* Finish early if end of backing file has been reached */
+ if (ret == 0 && n == 0) {
+ n = end - sector_num;
+ }
+
copy = (ret == 1);
}
trace_stream_one_iteration(s, sector_num, n, ret);