From bbc8ea98bc8a2ba8174d106184f3089248d5ec5d Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 29 Sep 2016 18:47:03 +0200 Subject: block-backend: Remember if attached device is non-qdev Almost all block devices are qdevified by now. This allows us to go back from the BlockBackend to the DeviceState. xen_disk is the last device that is missing. We'll remember in the BlockBackend if a xen_disk is attached and can then disable any features that require going from a BB to the DeviceState. While at it, clearly mark the function used by xen_disk as legacy even in its name, not just in TODO comments. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- hw/block/xen_disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 5aa350a..1292a4b 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -1079,7 +1079,7 @@ static int blk_connect(struct XenDevice *xendev) * so we can blk_unref() unconditionally */ blk_ref(blkdev->blk); } - blk_attach_dev_nofail(blkdev->blk, blkdev); + blk_attach_dev_legacy(blkdev->blk, blkdev); blkdev->file_size = blk_getlength(blkdev->blk); if (blkdev->file_size < 0) { BlockDriverState *bs = blk_bs(blkdev->blk); -- cgit v1.1