qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 27/29] block: prepare code for adding block notifier


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 27/29] block: prepare code for adding block notifiers
Date: Fri, 19 Oct 2012 15:32:06 +0200

There is no reason in principle to skip job cancellation and draining
of pending I/O when there is no medium in the disk.  Do these unconditionally,
which also prepares the code for the next patch.

Signed-off-by: Paolo Bonzini <address@hidden>
---
 block.c | 10 +++++-----
 1 file modificato, 5 inserzioni(+), 5 rimozioni(-)

diff --git a/block.c b/block.c
index e95f613..2e4ddea 100644
--- a/block.c
+++ b/block.c
@@ -1098,12 +1098,12 @@ void bdrv_reopen_abort(BDRVReopenState *reopen_state)
 void bdrv_close(BlockDriverState *bs)
 {
     bdrv_flush(bs);
-    if (bs->drv) {
-        if (bs->job) {
-            block_job_cancel_sync(bs->job);
-        }
-        bdrv_drain_all();
+    if (bs->job) {
+        block_job_cancel_sync(bs->job);
+    }
+    bdrv_drain_all();
 
+    if (bs->drv) {
         if (bs == bs_snapshots) {
             bs_snapshots = NULL;
         }
-- 
1.7.12.1





reply via email to

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