peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch

298366
From 670599a08c052f6ef841743731a8f06d4b50ec99 Mon Sep 17 00:00:00 2001
298366
From: Stefan Hajnoczi <stefanha@redhat.com>
298366
Date: Thu, 27 Jun 2013 15:32:26 +0200
298366
Subject: [PATCH] block: ensure bdrv_drain_all() works during bdrv_delete()
298366
298366
In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close()
298366
so that the device is still seen by bdrv_drain_all() when iterating
298366
bdrv_states.
298366
298366
Cc: qemu-stable@nongnu.org
298366
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
298366
(cherry picked from commit e1b5c52e04d04bb93546c6e37e8884889d047cb1)
298366
298366
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
298366
---
298366
 block.c | 4 ++--
298366
 1 file changed, 2 insertions(+), 2 deletions(-)
298366
298366
diff --git a/block.c b/block.c
298366
index 01b66d8..d5ce8d3 100644
298366
--- a/block.c
298366
+++ b/block.c
298366
@@ -1606,11 +1606,11 @@ void bdrv_delete(BlockDriverState *bs)
298366
     assert(!bs->job);
298366
     assert(!bs->in_use);
298366
 
298366
+    bdrv_close(bs);
298366
+
298366
     /* remove from list, if necessary */
298366
     bdrv_make_anon(bs);
298366
 
298366
-    bdrv_close(bs);
298366
-
298366
     g_free(bs);
298366
 }
298366