diff mbox

[3/3] block: mark streaming job busy at the end

Message ID 1334754723-11153-4-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini April 18, 2012, 1:12 p.m. UTC
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 <pbonzini@redhat.com>
---
 block/stream.c |    1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

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);
     }