提交 e6f746b3 编写于 作者: A Andreas Färber 提交者: Paolo Bonzini

virtio-net: Convert to QOM realize

Signed-off-by: NAndreas Färber <afaerber@suse.de>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 86346244
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册