aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-03-27 16:03:07 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-03-27 16:05:21 +0000
commit7429f2e1981c6cc77a853e2e88654001bdddd461 (patch)
treeb6cf21b0d33271f8bc9c251f735ce05bb64209f8 /hw
parent028c85f0fffe5d4fdd435e06af4188397acf1cb6 (diff)
xen_disk: detach the blkdev before bdrv_delete
We need to detach the blkdev from the BlockDriverState before calling bdrv_delete. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xen_disk.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 68fa36a1cf..bf06fc1978 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -726,6 +726,7 @@ static void blk_disconnect(struct XenDevice *xendev)
if (!blkdev->dinfo) {
/* close/delete only if we created it ourself */
bdrv_close(blkdev->bs);
+ bdrv_detach_dev(blkdev->bs, blkdev);
bdrv_delete(blkdev->bs);
}
blkdev->bs = NULL;