Kevin noted how the part of stream_run() that is after the for loop runs with
s->common.busy = false. At least bdrv_change_backing_file() can yield,
possibly other functions, too.

The race window is really small but it's there.  Thanks to the new,
more flexible implementation of block_job_cancel_sync we can fix it
easily.

Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
 block/stream.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/block/stream.c b/block/stream.c
index d38f30a..ea3566d 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -149,6 +149,7 @@ retry:
         co_sleep_ns(rt_clock, 0);
     }
 
+    s->common.busy = true;
     if (!base) {
         bdrv_disable_copy_on_read(bs);
     }
-- 
1.7.9.3


Reply via email to