diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-02-27 11:52:17 +0100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2015-03-09 15:00:07 +0100 |
commit | 28b07e737eb58f299b066c1c6b3740bb055a2cf9 (patch) | |
tree | 1098375236abebb68267a1e41724b9238ab33533 /hw/net | |
parent | e5f6e7327a95bf4c7e9354cd00e03d7ffaf25f8e (diff) |
spapr_vio: Convert to realize()
Bonus fix: always set an error on failure. Some failures were silent
before, except for the generic error set by device_realize().
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/net')
-rw-r--r-- | hw/net/spapr_llan.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c index c255d925a7..2dd5ec1117 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -203,7 +203,7 @@ static void spapr_vlan_reset(VIOsPAPRDevice *sdev) dev->isopen = 0; } -static int spapr_vlan_init(VIOsPAPRDevice *sdev) +static void spapr_vlan_realize(VIOsPAPRDevice *sdev, Error **errp) { VIOsPAPRVLANDevice *dev = VIO_SPAPR_VLAN_DEVICE(sdev); @@ -212,8 +212,6 @@ static int spapr_vlan_init(VIOsPAPRDevice *sdev) dev->nic = qemu_new_nic(&net_spapr_vlan_info, &dev->nicconf, object_get_typename(OBJECT(sdev)), sdev->qdev.id, dev); qemu_format_nic_info_str(qemu_get_queue(dev->nic), dev->nicconf.macaddr.a); - - return 0; } static void spapr_vlan_instance_init(Object *obj) @@ -534,7 +532,7 @@ static void spapr_vlan_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); VIOsPAPRDeviceClass *k = VIO_SPAPR_DEVICE_CLASS(klass); - k->init = spapr_vlan_init; + k->realize = spapr_vlan_realize; k->reset = spapr_vlan_reset; k->devnode = spapr_vlan_devnode; k->dt_name = "l-lan"; |