summaryrefslogtreecommitdiffstats
path: root/hw/net/vmxnet3.c
diff options
context:
space:
mode:
authorMarkus Armbruster2015-01-19 15:52:30 +0100
committerMichael S. Tsirkin2015-02-26 12:42:16 +0100
commit9af21dbee14c5165598d17115ade63184ec0dd8b (patch)
tree8bb365934bdac7cb5e1b2cb7cf1dbc32aea4655a /hw/net/vmxnet3.c
parentpci: Permit incremental conversion of device models to realize (diff)
downloadqemu-9af21dbee14c5165598d17115ade63184ec0dd8b.tar.gz
qemu-9af21dbee14c5165598d17115ade63184ec0dd8b.tar.xz
qemu-9af21dbee14c5165598d17115ade63184ec0dd8b.zip
pci: Trivial device model conversions to realize
Convert the device models where initialization obviously can't fail. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Diffstat (limited to 'hw/net/vmxnet3.c')
-rw-r--r--hw/net/vmxnet3.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index a83d2a11ff..dfb328debd 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -2125,7 +2125,7 @@ static const MemoryRegionOps b1_ops = {
},
};
-static int vmxnet3_pci_init(PCIDevice *pci_dev)
+static void vmxnet3_pci_realize(PCIDevice *pci_dev, Error **errp)
{
DeviceState *dev = DEVICE(pci_dev);
VMXNET3State *s = VMXNET3(pci_dev);
@@ -2164,8 +2164,6 @@ static int vmxnet3_pci_init(PCIDevice *pci_dev)
register_savevm(dev, "vmxnet3-msix", -1, 1,
vmxnet3_msix_save, vmxnet3_msix_load, s);
-
- return 0;
}
static void vmxnet3_instance_init(Object *obj)
@@ -2501,7 +2499,7 @@ static void vmxnet3_class_init(ObjectClass *class, void *data)
DeviceClass *dc = DEVICE_CLASS(class);
PCIDeviceClass *c = PCI_DEVICE_CLASS(class);
- c->init = vmxnet3_pci_init;
+ c->realize = vmxnet3_pci_realize;
c->exit = vmxnet3_pci_uninit;
c->vendor_id = PCI_VENDOR_ID_VMWARE;
c->device_id = PCI_DEVICE_ID_VMWARE_VMXNET3;