From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPpTT-0003iT-BA for qemu-devel@nongnu.org; Fri, 05 Sep 2014 05:06:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPpTL-0006Es-PX for qemu-devel@nongnu.org; Fri, 05 Sep 2014 05:06:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPpTL-0006Eh-ID for qemu-devel@nongnu.org; Fri, 05 Sep 2014 05:06:23 -0400 Message-ID: <1409907966.20018.7.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Fri, 05 Sep 2014 11:06:06 +0200 In-Reply-To: <1409906256-11368-19-git-send-email-arei.gonglei@huawei.com> References: <1409906256-11368-1-git-send-email-arei.gonglei@huawei.com> <1409906256-11368-19-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7 18/28] host-libusb: remove bootindex property from qdev to qom List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com Cc: chenliang88@huawei.com, weidong.huang@huawei.com, mst@redhat.com, aik@ozlabs.ru, hutao@cn.fujitsu.com, qemu-devel@nongnu.org, armbru@redhat.com, akong@redhat.com, agraf@suse.de, 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 > +static void usb_host_instance_init(Object *obj) > +{ > + USBDevice *udev = USB_DEVICE(obj); > + USBHostDevice *s = USB_HOST_DEVICE(udev); > + > + device_add_bootindex_property(obj, &s->bootindex, > + "bootindex", NULL, > + &udev->qdev, NULL); > + object_property_set_int(obj, -1, "bootindex", NULL); I think the object_property_set_int() call can be moved to device_add_bootindex_property, so there is no need to duplicate the call to init bootindex with -1 in all devices. cheers, Gerd