aboutsummaryrefslogtreecommitdiff
path: root/hw/xen_disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xen_disk.c')
-rw-r--r--hw/xen_disk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 9719395b09..22dbd10303 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -745,6 +745,10 @@ static int blk_free(struct XenDevice *xendev)
struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
struct ioreq *ioreq;
+ if (blkdev->bs || blkdev->sring) {
+ blk_disconnect(xendev);
+ }
+
while (!QLIST_EMPTY(&blkdev->freelist)) {
ioreq = QLIST_FIRST(&blkdev->freelist);
QLIST_REMOVE(ioreq, list);