Received: from eggs.gnu.org ([2001:4830:134:3::10]:43289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPp2l-0005HR-KG for qemu-devel@nongnu.org; Fri, 05 Sep 2014 04:39:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPp2g-0003Lw-IU for qemu-devel@nongnu.org; Fri, 05 Sep 2014 04:38:55 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:58628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPp2f-0003LG-UE for qemu-devel@nongnu.org; Fri, 05 Sep 2014 04:38:50 -0400 From: Date: Fri, 5 Sep 2014 16:37:29 +0800 Message-ID: <1409906256-11368-22-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 21/28] redirect: remove bootindex property from qdev to qom 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 Remove bootindex form qdev property to qom, 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/usb/redirect.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 44522d9..352ba80 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -2468,7 +2468,6 @@ static Property usbredir_properties[] = { DEFINE_PROP_CHR("chardev", USBRedirDevice, cs), DEFINE_PROP_UINT8("debug", USBRedirDevice, debug, usbredirparser_warning), DEFINE_PROP_STRING("filter", USBRedirDevice, filter_str), - DEFINE_PROP_INT32("bootindex", USBRedirDevice, bootindex, -1), DEFINE_PROP_END_OF_LIST(), }; @@ -2493,11 +2492,23 @@ static void usbredir_class_initfn(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_MISC, dc->categories); } +static void usbredir_instance_init(Object *obj) +{ + USBDevice *udev = USB_DEVICE(obj); + USBRedirDevice *dev = DO_UPCAST(USBRedirDevice, dev, udev); + + device_add_bootindex_property(obj, &dev->bootindex, + "bootindex", NULL, + &udev->qdev, NULL); + object_property_set_int(obj, -1, "bootindex", NULL); +} + static const TypeInfo usbredir_dev_info = { .name = "usb-redir", .parent = TYPE_USB_DEVICE, .instance_size = sizeof(USBRedirDevice), .class_init = usbredir_class_initfn, + .instance_init = usbredir_instance_init, }; static void usbredir_register_types(void) -- 1.7.12.4