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