mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
scsi: Convert remaining PCI HBAs to realize()
These are "am53c974", "dc390", "lsi53c895a", "lsi53c810", "megasas", "megasas-gen2". Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-Id: <1425925048-15482-5-git-send-email-armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
390e90a907
commit
ae071cc851
3 changed files with 17 additions and 41 deletions
|
@ -28,7 +28,6 @@
|
|||
#include "hw/scsi/scsi.h"
|
||||
#include "block/scsi.h"
|
||||
#include "trace.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
|
||||
#include "mfi.h"
|
||||
|
||||
|
@ -2321,14 +2320,13 @@ static const struct SCSIBusInfo megasas_scsi_info = {
|
|||
.cancel = megasas_command_cancel,
|
||||
};
|
||||
|
||||
static int megasas_scsi_init(PCIDevice *dev)
|
||||
static void megasas_scsi_realize(PCIDevice *dev, Error **errp)
|
||||
{
|
||||
DeviceState *d = DEVICE(dev);
|
||||
MegasasState *s = MEGASAS(dev);
|
||||
MegasasBaseClass *b = MEGASAS_DEVICE_GET_CLASS(s);
|
||||
uint8_t *pci_conf;
|
||||
int i, bar_type;
|
||||
Error *err = NULL;
|
||||
|
||||
pci_conf = dev->config;
|
||||
|
||||
|
@ -2408,14 +2406,8 @@ static int megasas_scsi_init(PCIDevice *dev)
|
|||
scsi_bus_new(&s->bus, sizeof(s->bus), DEVICE(dev),
|
||||
&megasas_scsi_info, NULL);
|
||||
if (!d->hotplugged) {
|
||||
scsi_bus_legacy_handle_cmdline(&s->bus, &err);
|
||||
if (err != NULL) {
|
||||
qerror_report_err(err);
|
||||
error_free(err);
|
||||
return -1;
|
||||
}
|
||||
scsi_bus_legacy_handle_cmdline(&s->bus, errp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2509,7 +2501,7 @@ static void megasas_class_init(ObjectClass *oc, void *data)
|
|||
MegasasBaseClass *e = MEGASAS_DEVICE_CLASS(oc);
|
||||
const MegasasInfo *info = data;
|
||||
|
||||
pc->init = megasas_scsi_init;
|
||||
pc->realize = megasas_scsi_realize;
|
||||
pc->exit = megasas_scsi_uninit;
|
||||
pc->vendor_id = PCI_VENDOR_ID_LSI_LOGIC;
|
||||
pc->device_id = info->device_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue