From fa879d62eb51253d00b6920ce1d1d9d261370a49 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 3 Aug 2011 15:07:40 +0200 Subject: block: Attach non-qdev devices as well For now, this just protects against programming errors like having the same drive back multiple non-qdev devices, or untimely bdrv_delete(). Later commits will add other interesting uses. While there, rename BlockDriverState member peer to dev, bdrv_attach() to bdrv_attach_dev(), bdrv_detach() to bdrv_detach_dev(), and bdrv_get_attached() to bdrv_get_attached_dev(). Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- hw/xen_disk.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/xen_disk.c') diff --git a/hw/xen_disk.c b/hw/xen_disk.c index bd5c66916b..da531a67dd 100644 --- a/hw/xen_disk.c +++ b/hw/xen_disk.c @@ -697,6 +697,7 @@ static int blk_init(struct XenDevice *xendev) xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n"); blkdev->bs = blkdev->dinfo->bdrv; } + bdrv_attach_dev_nofail(blkdev->bs, blkdev); blkdev->file_blk = BLOCK_SIZE; blkdev->file_size = bdrv_getlength(blkdev->bs); if (blkdev->file_size < 0) { -- cgit v1.2.3