diff options
author | Peter Maydell | 2014-10-22 17:39:49 +0200 |
---|---|---|
committer | Peter Maydell | 2014-10-22 17:39:49 +0200 |
commit | 8f4699d873bef81cec95db6da53d4c33f8caf4b9 (patch) | |
tree | 249e2a7bb71c26b66643162f98e2659d83c79d4d /hw/scsi/scsi-bus.c | |
parent | Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20141015-2' into s... (diff) | |
parent | block: Make device model's references to BlockBackend strong (diff) | |
download | qemu-8f4699d873bef81cec95db6da53d4c33f8caf4b9.tar.gz qemu-8f4699d873bef81cec95db6da53d4c33f8caf4b9.tar.xz qemu-8f4699d873bef81cec95db6da53d4c33f8caf4b9.zip |
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block patches
# gpg: Signature made Mon 20 Oct 2014 13:04:09 BST using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
* remotes/kevin/tags/for-upstream: (28 commits)
block: Make device model's references to BlockBackend strong
block: Lift device model API into BlockBackend
blockdev: Convert qmp_eject(), qmp_change_blockdev() to BlockBackend
block/qapi: Convert qmp_query_block() to BlockBackend
blockdev: Fix blockdev-add not to create DriveInfo
blockdev: Drop superfluous DriveInfo member id
pc87312: Drop unused members of PC87312State
ide: Complete conversion from BlockDriverState to BlockBackend
hw: Convert from BlockDriverState to BlockBackend, mostly
virtio-blk: Rename VirtIOBlkConf variables to conf
virtio-blk: Drop redundant VirtIOBlock member conf
block: Rename BlockDriverCompletionFunc to BlockCompletionFunc
block: Rename BlockDriverAIOCB* to BlockAIOCB*
block: Eliminate DriveInfo member bdrv, use blk_by_legacy_dinfo()
block: Merge BlockBackend and BlockDriverState name spaces
block: Eliminate BlockDriverState member device_name[]
block: Eliminate bdrv_iterate(), use bdrv_next()
blockdev: Eliminate drive_del()
block: Make BlockBackend own its BlockDriverState
block: Code motion to get rid of stubs/blockdev.c
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/scsi/scsi-bus.c')
-rw-r--r-- | hw/scsi/scsi-bus.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 022a524074..af7707cf27 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -3,6 +3,7 @@ #include "hw/scsi/scsi.h" #include "block/scsi.h" #include "hw/qdev.h" +#include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "trace.h" #include "sysemu/dma.h" @@ -221,7 +222,7 @@ static void scsi_qdev_unrealize(DeviceState *qdev, Error **errp) } /* handle legacy '-drive if=scsi,...' cmd line args */ -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) { @@ -229,7 +230,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockDriverState *bdrv, DeviceState *dev; Error *err = NULL; - driver = bdrv_is_sg(bdrv) ? "scsi-generic" : "scsi-disk"; + driver = blk_is_sg(blk) ? "scsi-generic" : "scsi-disk"; dev = qdev_create(&bus->qbus, driver); qdev_prop_set_uint32(dev, "scsi-id", unit); if (bootindex >= 0) { @@ -242,7 +243,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockDriverState *bdrv, if (serial && object_property_find(OBJECT(dev), "serial", NULL)) { qdev_prop_set_string(dev, "serial", serial); } - if (qdev_prop_set_drive(dev, "drive", bdrv) < 0) { + if (qdev_prop_set_drive(dev, "drive", blk) < 0) { error_setg(errp, "Setting drive property failed"); object_unparent(OBJECT(dev)); return NULL; @@ -270,8 +271,8 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, Error **errp) continue; } qemu_opts_loc_restore(dinfo->opts); - scsi_bus_legacy_add_drive(bus, dinfo->bdrv, unit, false, -1, NULL, - &err); + scsi_bus_legacy_add_drive(bus, blk_by_legacy_dinfo(dinfo), + unit, false, -1, NULL, &err); if (err != NULL) { error_report("%s", error_get_pretty(err)); error_propagate(errp, err); @@ -1753,7 +1754,7 @@ void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier) scsi_req_dequeue(req); req->io_canceled = true; if (req->aiocb) { - bdrv_aio_cancel_async(req->aiocb); + blk_aio_cancel_async(req->aiocb); } } @@ -1767,7 +1768,7 @@ void scsi_req_cancel(SCSIRequest *req) scsi_req_dequeue(req); req->io_canceled = true; if (req->aiocb) { - bdrv_aio_cancel(req->aiocb); + blk_aio_cancel(req->aiocb); } } |