提交 dfe79cf2 编写于 作者: G Gonglei 提交者: Gerd Hoffmann

spapr_lian: add bootindex to qom property

Add a qom property with the same name 'bootindex',
when we remove it form qdev property, things will
continue to work just fine, and we can use qom features
which are not supported by qdev property.
Signed-off-by: NGonglei <arei.gonglei@huawei.com>
Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 afd7c850
...@@ -226,6 +226,15 @@ static int spapr_vlan_init(VIOsPAPRDevice *sdev) ...@@ -226,6 +226,15 @@ static int spapr_vlan_init(VIOsPAPRDevice *sdev)
return 0; return 0;
} }
static void spapr_vlan_instance_init(Object *obj)
{
VIOsPAPRVLANDevice *dev = VIO_SPAPR_VLAN_DEVICE(obj);
device_add_bootindex_property(obj, &dev->nicconf.bootindex,
"bootindex", "",
DEVICE(dev), NULL);
}
void spapr_vlan_create(VIOsPAPRBus *bus, NICInfo *nd) void spapr_vlan_create(VIOsPAPRBus *bus, NICInfo *nd)
{ {
DeviceState *dev; DeviceState *dev;
...@@ -553,6 +562,7 @@ static const TypeInfo spapr_vlan_info = { ...@@ -553,6 +562,7 @@ static const TypeInfo spapr_vlan_info = {
.parent = TYPE_VIO_SPAPR_DEVICE, .parent = TYPE_VIO_SPAPR_DEVICE,
.instance_size = sizeof(VIOsPAPRVLANDevice), .instance_size = sizeof(VIOsPAPRVLANDevice),
.class_init = spapr_vlan_class_init, .class_init = spapr_vlan_class_init,
.instance_init = spapr_vlan_instance_init,
}; };
static void spapr_vlan_register_types(void) static void spapr_vlan_register_types(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册