aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi/vmw_pvscsi.c
diff options
context:
space:
mode:
authorMao Zhongyi <maozy.fnst@cn.fujitsu.com>2017-07-26 16:41:53 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2017-08-01 17:27:33 +0200
commitfafeb41cd0abac412d7c77da1b680d5df805b454 (patch)
tree928d6393d51b38267e7a26934baaf12524f39aa5 /hw/scsi/vmw_pvscsi.c
parentdfaea0c1a8482c5410917f91a9e2b88d4954b69e (diff)
hw/scsi/vmw_pvscsi: Convert to realize
Convert a device model where initialization obviously can't fail, make it implement realize() rather than init(). Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com> Message-Id: <20170726084153.10121-2-maozy.fnst@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/vmw_pvscsi.c')
-rw-r--r--hw/scsi/vmw_pvscsi.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index d92973ede1..77d8b6f9e2 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -1103,8 +1103,8 @@ static const struct SCSIBusInfo pvscsi_scsi_info = {
.cancel = pvscsi_request_cancelled,
};
-static int
-pvscsi_init(PCIDevice *pci_dev)
+static void
+pvscsi_realizefn(PCIDevice *pci_dev, Error **errp)
{
PVSCSIState *s = PVSCSI(pci_dev);
@@ -1144,8 +1144,6 @@ pvscsi_init(PCIDevice *pci_dev)
/* override default SCSI bus hotplug-handler, with pvscsi's one */
qbus_set_hotplug_handler(BUS(&s->bus), DEVICE(s), &error_abort);
pvscsi_reset_state(s);
-
- return 0;
}
static void
@@ -1278,7 +1276,7 @@ static void pvscsi_class_init(ObjectClass *klass, void *data)
PVSCSIClass *pvs_k = PVSCSI_DEVICE_CLASS(klass);
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
- k->init = pvscsi_init;
+ k->realize = pvscsi_realizefn;
k->exit = pvscsi_uninit;
k->vendor_id = PCI_VENDOR_ID_VMWARE;
k->device_id = PCI_DEVICE_ID_VMWARE_PVSCSI;