thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch

0a122b
From 0487ca6807db23556550e12585924546ed9923af Mon Sep 17 00:00:00 2001
0a122b
From: Fam Zheng <famz@redhat.com>
0a122b
Date: Tue, 21 Jan 2014 02:59:42 +0100
0a122b
Subject: [PATCH 30/34] block: ensure bdrv_drain_all() works during bdrv_delete()
0a122b
0a122b
RH-Author: Fam Zheng <famz@redhat.com>
0a122b
Message-id: <1390273182-31302-1-git-send-email-famz@redhat.com>
0a122b
Patchwork-id: 56851
0a122b
O-Subject: [RHEL-7 qemu-kvm PATCH 19/18] block: ensure bdrv_drain_all() works during bdrv_delete()
0a122b
Bugzilla: 1041301
0a122b
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
0a122b
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
0a122b
From: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
0a122b
In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close()
0a122b
so that the device is still seen by bdrv_drain_all() when iterating
0a122b
bdrv_states.
0a122b
0a122b
Cc: qemu-stable@nongnu.org
0a122b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
(cherry picked from commit e1b5c52e04d04bb93546c6e37e8884889d047cb1)
0a122b
Signed-off-by: Fam Zheng <famz@redhat.com>
0a122b
---
0a122b
 block.c | 4 ++--
0a122b
 1 file changed, 2 insertions(+), 2 deletions(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 block.c |    4 ++--
0a122b
 1 files changed, 2 insertions(+), 2 deletions(-)
0a122b
0a122b
diff --git a/block.c b/block.c
0a122b
index b4e3ced..3232971 100644
0a122b
--- a/block.c
0a122b
+++ b/block.c
0a122b
@@ -1674,11 +1674,11 @@ static void bdrv_delete(BlockDriverState *bs)
0a122b
     assert(!bs->in_use);
0a122b
     assert(!bs->refcnt);
0a122b
 
0a122b
+    bdrv_close(bs);
0a122b
+
0a122b
     /* remove from list, if necessary */
0a122b
     bdrv_make_anon(bs);
0a122b
 
0a122b
-    bdrv_close(bs);
0a122b
-
0a122b
     g_free(bs);
0a122b
 }
0a122b
 
0a122b
-- 
0a122b
1.7.1
0a122b