From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeKXp-0006Z4-Oa for qemu-devel@nongnu.org; Wed, 15 Oct 2014 05:07:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XeKXg-000733-BI for qemu-devel@nongnu.org; Wed, 15 Oct 2014 05:06:57 -0400 From: Gerd Hoffmann Date: Wed, 15 Oct 2014 11:05:47 +0200 Message-Id: <1413363967-2489-15-git-send-email-kraxel@redhat.com> In-Reply-To: <1413363967-2489-1-git-send-email-kraxel@redhat.com> References: <1413363967-2489-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 14/34] spapr_lian: add bootindex to qom property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gonglei , "open list:sPAPR" , Gerd Hoffmann , Alexander Graf From: Gonglei 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: Gonglei Reviewed-by: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- hw/net/spapr_llan.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c index 23c47d3..0ff159b 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -226,6 +226,15 @@ static int spapr_vlan_init(VIOsPAPRDevice *sdev) 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) { DeviceState *dev; @@ -553,6 +562,7 @@ static const TypeInfo spapr_vlan_info = { .parent = TYPE_VIO_SPAPR_DEVICE, .instance_size = sizeof(VIOsPAPRVLANDevice), .class_init = spapr_vlan_class_init, + .instance_init = spapr_vlan_instance_init, }; static void spapr_vlan_register_types(void) -- 1.8.3.1