qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/3] block: mark streaming job busy at the end


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 3/3] block: mark streaming job busy at the end
Date: Wed, 18 Apr 2012 15:12:03 +0200

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 <address@hidden>
---
 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

[Prev in Thread] Current Thread [Next in Thread]