[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/17] hw/scsi/vmw_pvscsi: Convert to realize
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 13/17] hw/scsi/vmw_pvscsi: Convert to realize |
Date: |
Tue, 1 Aug 2017 18:17:21 +0200 |
From: Mao Zhongyi <address@hidden>
Convert a device model where initialization obviously
can't fail, make it implement realize() rather than init().
Reviewed-by: Dmitry Fleytman <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Markus Armbruster <address@hidden>
Signed-off-by: Mao Zhongyi <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi/vmw_pvscsi.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index d92973e..77d8b6f 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;
--
1.8.3.1
- [Qemu-devel] [PULL 01/17] vl.c/exit: pause cpus before closing block devices, (continued)
- [Qemu-devel] [PULL 01/17] vl.c/exit: pause cpus before closing block devices, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 05/17] char: don't exit on hmp 'chardev-add help', Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 04/17] char-fd: remove useless chr pointer, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 03/17] accel: cleanup error output, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 06/17] docs: document deprecation policy & deprecated features in appendix, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 08/17] exec: Add lock parameter to qemu_ram_ptr_length, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 09/17] bt: stop the sdp memory allocation craziness, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 10/17] qemu-options: document existance of versioned machine types, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 11/17] migration: optimize the downtime, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 12/17] hw/scsi/vmw_pvscsi: Remove the dead error handling, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 13/17] hw/scsi/vmw_pvscsi: Convert to realize,
Paolo Bonzini <=
- [Qemu-devel] [PULL 14/17] rtc-test: cleanup register_b_set_flag test, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 15/17] rtc-test: introduce more update tests, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 16/17] mc146818rtc: simplify check_update_timer, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 17/17] mc146818rtc: implement UIP latching as intended, Paolo Bonzini, 2017/08/01
- [Qemu-devel] [PULL 07/17] target-i386: kvm_get/put_vcpu_events don't handle sipi_vector, Paolo Bonzini, 2017/08/01
- Re: [Qemu-devel] [PULL 00/17] Misc changes for QEMU 2.10-rc1 (?), no-reply, 2017/08/01