aboutsummaryrefslogtreecommitdiff
path: root/hw/block/xen_disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/block/xen_disk.c')
-rw-r--r--hw/block/xen_disk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 727f4331c0..8bfa04ec58 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -813,7 +813,7 @@ static int blk_connect(struct XenDevice *xendev)
readonly);
if (bdrv_open(blkdev->bs,
blkdev->filename, NULL, qflags, drv) != 0) {
- bdrv_delete(blkdev->bs);
+ bdrv_unref(blkdev->bs);
blkdev->bs = NULL;
}
}
@@ -926,7 +926,7 @@ static void blk_disconnect(struct XenDevice *xendev)
/* close/delete only if we created it ourself */
bdrv_close(blkdev->bs);
bdrv_detach_dev(blkdev->bs, blkdev);
- bdrv_delete(blkdev->bs);
+ bdrv_unref(blkdev->bs);
}
blkdev->bs = NULL;
}