aboutsummaryrefslogtreecommitdiff
path: root/block/stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/stream.c')
-rw-r--r--block/stream.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/block/stream.c b/block/stream.c
index 694fd42e41..46bec7d379 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -88,6 +88,11 @@ static void coroutine_fn stream_run(void *opaque)
int n = 0;
void *buf;
+ if (!bs->backing_hd) {
+ block_job_completed(&s->common, 0);
+ return;
+ }
+
s->common.len = bdrv_getlength(bs);
if (s->common.len < 0) {
block_job_completed(&s->common, s->common.len);