From 7429f2e1981c6cc77a853e2e88654001bdddd461 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Tue, 27 Mar 2012 16:03:07 +0000 Subject: [PATCH] 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 --- hw/xen_disk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/xen_disk.c b/hw/xen_disk.c index 68fa36a..bf06fc1 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; -- 2.7.4