From 4be746345f13e99e468c60acbd3a355e8183e3ce Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 7 Oct 2014 13:59:18 +0200 Subject: hw: Convert from BlockDriverState to BlockBackend, mostly Device models should access their block backends only through the block-backend.h API. Convert them, and drop direct includes of inappropriate headers. Just four uses of BlockDriverState are left: * The Xen paravirtual block device backend (xen_disk.c) opens images itself when set up via xenbus, bypassing blockdev.c. I figure it should go through qmp_blockdev_add() instead. * Device model "usb-storage" prompts for keys. No other device model does, and this one probably shouldn't do it, either. * ide_issue_trim_cb() uses bdrv_aio_discard() instead of blk_aio_discard() because it fishes its backend out of a BlockAIOCB, which has only the BlockDriverState. * PC87312State has an unused BlockDriverState[] member. The next two commits take care of the latter two. Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- include/hw/scsi/scsi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/hw/scsi') diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 809aefb8c1..6bc841ab8b 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -2,7 +2,7 @@ #define QEMU_HW_SCSI_H #include "hw/qdev.h" -#include "block/block.h" +#include "qemu/typedefs.h" #include "hw/block/block.h" #include "sysemu/sysemu.h" #include "qemu/notify.h" @@ -173,7 +173,7 @@ static inline SCSIBus *scsi_bus_from_device(SCSIDevice *d) return DO_UPCAST(SCSIBus, qbus, d->qdev.parent_bus); } -SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockDriverState *bdrv, +SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, int unit, bool removable, int bootindex, const char *serial, Error **errp); void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, Error **errp); -- cgit v1.2.3