diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-08-31 14:24:04 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-09-09 14:57:19 -0500 |
commit | d52affa7f6b9df3c7d44da0effbdfc8339c43914 (patch) | |
tree | f846e1baed7d228519ba95bfd3d915529e7172f9 /hw/pci-hotplug.c | |
parent | 5b19d9a247c47fe52c4f3d3e844009a689ee6b28 (diff) | |
download | qemu-d52affa7f6b9df3c7d44da0effbdfc8339c43914.zip |
qdev/scsi: add scsi bus support to qdev, convert drivers.
* Add SCSIBus.
* Add SCSIDeviceInfo, move device callbacks here.
* add qdev/scsi helper functions.
* convert drivers.
Adding scsi disks via -device works now, i.e. you can do:
-drive id=sda,if=none,...
-device lsi
-device scsi-disk,drive=sda
legacy command lines (-drive if=scsi,...) continue to work.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci-hotplug.c')
-rw-r--r-- | hw/pci-hotplug.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 6bd837a401..5348dd1b2e 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -30,6 +30,7 @@ #include "pc.h" #include "monitor.h" #include "block_int.h" +#include "scsi-disk.h" #include "virtio-blk.h" #if defined(TARGET_I386) || defined(TARGET_X86_64) @@ -58,6 +59,7 @@ void drive_hot_add(Monitor *mon, const QDict *qdict) DriveInfo *dinfo; const char *pci_addr = qdict_get_str(qdict, "pci_addr"); const char *opts = qdict_get_str(qdict, "opts"); + BusState *scsibus; if (pci_read_devaddr(mon, pci_addr, &dom, &pci_bus, &slot)) { return; @@ -82,8 +84,9 @@ void drive_hot_add(Monitor *mon, const QDict *qdict) switch (type) { case IF_SCSI: success = 1; - lsi_scsi_attach(&dev->qdev, dinfo->bdrv, - dinfo->unit); + scsibus = LIST_FIRST(&dev->qdev.child_bus); + scsi_bus_legacy_add_drive(DO_UPCAST(SCSIBus, qbus, scsibus), + dinfo, dinfo->unit); break; default: monitor_printf(mon, "Can't hot-add drive to type %d\n", type); |