diff options
author | Andreas Färber <afaerber@suse.de> | 2013-07-30 02:36:06 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-12-09 21:46:49 +0100 |
commit | e6f746b380ad04246e5cce621f174355f39addcd (patch) | |
tree | 9e0fb76fa3704cea1f214f92c8a0f23aab9f6538 /hw/net/virtio-net.c | |
parent | 863462440d646098d2b83fb0ffa5f165e7f90511 (diff) |
virtio-net: Convert to QOM realize
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/net/virtio-net.c')
-rw-r--r-- | hw/net/virtio-net.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index a669f834e7..d9e4b8a5ab 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1486,9 +1486,9 @@ void virtio_net_set_netclient_name(VirtIONet *n, const char *name, n->netclient_type = g_strdup(type); } -static int virtio_net_device_init(VirtIODevice *vdev) +static void virtio_net_device_realize(DeviceState *dev, Error **errp) { - DeviceState *dev = DEVICE(vdev); + VirtIODevice *vdev = VIRTIO_DEVICE(dev); VirtIONet *n = VIRTIO_NET(dev); NetClientState *nc; int i; @@ -1565,7 +1565,6 @@ static int virtio_net_device_init(VirtIODevice *vdev) virtio_net_save, virtio_net_load, n); add_boot_device_path(n->nic_conf.bootindex, dev, "/ethernet-phy@0"); - return 0; } static void virtio_net_device_exit(VirtIODevice *vdev) @@ -1633,9 +1632,10 @@ static void virtio_net_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); + dc->props = virtio_net_properties; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); - vdc->init = virtio_net_device_init; + vdc->realize = virtio_net_device_realize; vdc->exit = virtio_net_device_exit; vdc->get_config = virtio_net_get_config; vdc->set_config = virtio_net_set_config; |