virtio-net: Convert to QOM realize

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Andreas Färber 2013-07-30 02:36:06 +02:00 committed by Paolo Bonzini
parent 863462440d
commit e6f746b380

View File

@ -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;