Received: from eggs.gnu.org ([2001:4830:134:3::10]:43085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPp2T-0004sz-Je for qemu-devel@nongnu.org; Fri, 05 Sep 2014 04:38:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPp2O-0003Gl-Mx for qemu-devel@nongnu.org; Fri, 05 Sep 2014 04:38:37 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:58350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPp2N-0003GG-Rb for qemu-devel@nongnu.org; Fri, 05 Sep 2014 04:38:32 -0400 From: Date: Fri, 5 Sep 2014 16:37:21 +0800 Message-ID: <1409906256-11368-14-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1409906256-11368-1-git-send-email-arei.gonglei@huawei.com> References: <1409906256-11368-1-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v7 13/28] rtl8139: add bootindex to qom property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: chenliang88@huawei.com, weidong.huang@huawei.com, mst@redhat.com, aik@ozlabs.ru, hutao@cn.fujitsu.com, armbru@redhat.com, kraxel@redhat.com, akong@redhat.com, agraf@suse.de, Gonglei , aliguori@amazon.com, ehabkost@redhat.com, luonengjun@huawei.com, peter.huangpeng@huawei.com, hani@linux.com, stefanha@redhat.com, pbonzini@redhat.com, lcapitulino@redhat.com, kwolf@redhat.com, peter.crosthwaite@xilinx.com, imammedo@redhat.com, afaerber@suse.de 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 --- hw/net/rtl8139.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 6e59f38..138a03a 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -3543,6 +3543,15 @@ static int pci_rtl8139_init(PCIDevice *dev) return 0; } +static void rtl8139_instance_init(Object *obj) +{ + RTL8139State *s = RTL8139(obj); + + device_add_bootindex_property(obj, &s->conf.bootindex, + "bootindex", "/ethernet-phy@0", + DEVICE(obj), NULL); +} + static Property rtl8139_properties[] = { DEFINE_NIC_PROPERTIES(RTL8139State, conf), DEFINE_PROP_END_OF_LIST(), @@ -3571,6 +3580,7 @@ static const TypeInfo rtl8139_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(RTL8139State), .class_init = rtl8139_class_init, + .instance_init = rtl8139_instance_init, }; static void rtl8139_register_types(void) -- 1.7.12.4