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>
This commit is contained in:
parent
028c85f0ff
commit
7429f2e198
|
@ -726,6 +726,7 @@ static void blk_disconnect(struct XenDevice *xendev)
|
||||||
if (!blkdev->dinfo) {
|
if (!blkdev->dinfo) {
|
||||||
/* close/delete only if we created it ourself */
|
/* close/delete only if we created it ourself */
|
||||||
bdrv_close(blkdev->bs);
|
bdrv_close(blkdev->bs);
|
||||||
|
bdrv_detach_dev(blkdev->bs, blkdev);
|
||||||
bdrv_delete(blkdev->bs);
|
bdrv_delete(blkdev->bs);
|
||||||
}
|
}
|
||||||
blkdev->bs = NULL;
|
blkdev->bs = NULL;
|
||||||
|
|
Loading…
Reference in a new issue