aboutsummaryrefslogtreecommitdiff
path: root/hw/pci-hotplug.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-05-02 09:00:20 +0200
committerAndreas Färber <afaerber@suse.de>2012-06-18 15:14:38 +0200
commit0d936928ef87ca1bb7b41b5b89c400c699a7691c (patch)
tree134a900379f06e1e84f31728a866d8afc7e9869a /hw/pci-hotplug.c
parent8185d21639ab749979445734ec671122aa96e805 (diff)
qdev: Convert busses to QEMU Object Model
This is far less interesting than it sounds. We simply add an Object to each BusState and then register the types appropriately. Most of the interesting refactoring will follow in the next patches. Since we're changing fundamental type names (BusInfo -> BusClass), it all needs to convert at once. Fortunately, not a lot of code is affected. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [AF: Made all new bus TypeInfos static const.] [AF: Made qbus_free() call object_delete(), required {qom,glib}_allocated] Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/pci-hotplug.c')
-rw-r--r--hw/pci-hotplug.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index 61257f457b..e7fb780a08 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -80,11 +80,7 @@ static int scsi_hot_add(Monitor *mon, DeviceState *adapter,
SCSIBus *scsibus;
SCSIDevice *scsidev;
- scsibus = DO_UPCAST(SCSIBus, qbus, QLIST_FIRST(&adapter->child_bus));
- if (!scsibus || strcmp(scsibus->qbus.info->name, "SCSI") != 0) {
- error_report("Device is not a SCSI adapter");
- return -1;
- }
+ scsibus = SCSI_BUS(QLIST_FIRST(&adapter->child_bus));
/*
* drive_init() tries to find a default for dinfo->unit. Doesn't