aboutsummaryrefslogtreecommitdiff
path: root/hw/spapr_llan.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-15 16:31:06 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:49 -0600
commit3954d33ab7f82f5a5fa0ced231849920265a5fec (patch)
tree2535349de87b099d02c5bf6cb328191ef23f593b /hw/spapr_llan.c
parentb9eea3e6a435a79fe308212157e0875442b760e4 (diff)
spapr: convert to QEMU Object Model (v2)
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - use QOM to check for the default console
Diffstat (limited to 'hw/spapr_llan.c')
-rw-r--r--hw/spapr_llan.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c
index b9a5afccbc..0fb176abad 100644
--- a/hw/spapr_llan.c
+++ b/hw/spapr_llan.c
@@ -474,20 +474,29 @@ static target_ulong h_multicast_ctrl(CPUState *env, sPAPREnvironment *spapr,
return H_SUCCESS;
}
-static VIOsPAPRDeviceInfo spapr_vlan_info = {
- .init = spapr_vlan_init,
- .devnode = spapr_vlan_devnode,
- .dt_name = "l-lan",
- .dt_type = "network",
- .dt_compatible = "IBM,l-lan",
- .signal_mask = 0x1,
- .qdev.name = "spapr-vlan",
- .qdev.size = sizeof(VIOsPAPRVLANDevice),
- .qdev.props = (Property[]) {
- DEFINE_SPAPR_PROPERTIES(VIOsPAPRVLANDevice, sdev, 0x1000, 0x10000000),
- DEFINE_NIC_PROPERTIES(VIOsPAPRVLANDevice, nicconf),
- DEFINE_PROP_END_OF_LIST(),
- },
+static Property spapr_vlan_properties[] = {
+ DEFINE_SPAPR_PROPERTIES(VIOsPAPRVLANDevice, sdev, 0x1000, 0x10000000),
+ DEFINE_NIC_PROPERTIES(VIOsPAPRVLANDevice, nicconf),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+static void spapr_vlan_class_init(ObjectClass *klass, void *data)
+{
+ VIOsPAPRDeviceClass *k = VIO_SPAPR_DEVICE_CLASS(klass);
+
+ k->init = spapr_vlan_init;
+ k->devnode = spapr_vlan_devnode;
+ k->dt_name = "l-lan";
+ k->dt_type = "network";
+ k->dt_compatible = "IBM,l-lan";
+ k->signal_mask = 0x1;
+}
+
+static DeviceInfo spapr_vlan_info = {
+ .name = "spapr-vlan",
+ .size = sizeof(VIOsPAPRVLANDevice),
+ .props = spapr_vlan_properties,
+ .class_init = spapr_vlan_class_init,
};
static void spapr_vlan_register(void)