From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrzyd-0002qt-8I for qemu-devel@nongnu.org; Mon, 30 Jan 2012 17:45:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rrzyb-00051o-Do for qemu-devel@nongnu.org; Mon, 30 Jan 2012 17:45:31 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:59733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrzyb-00051Z-5B for qemu-devel@nongnu.org; Mon, 30 Jan 2012 17:45:29 -0500 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Jan 2012 15:45:27 -0700 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 4FB9AC9004D for ; Mon, 30 Jan 2012 17:44:47 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q0UMi28Y456630 for ; Mon, 30 Jan 2012 17:44:11 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q0UMi1aT000541 for ; Mon, 30 Jan 2012 17:44:01 -0500 Message-ID: <4F271D2F.3070704@us.ibm.com> Date: Mon, 30 Jan 2012 16:43:59 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1327957741-5842-1-git-send-email-aliguori@us.ibm.com> <1327957741-5842-8-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/23] qdev: register all types natively through QEMU Object Model List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , Andreas Faerber , qemu-devel@nongnu.org On 01/30/2012 04:29 PM, Peter Maydell wrote: > On 30 January 2012 21:08, Anthony Liguori wrote: >> This was done in a mostly automated fashion. I did it in three steps and then >> rebased it into a single step which avoids repeatedly touching every file in >> the tree. >> >> The first step was a sed-based addition of the parent type to the subclass >> registration functions. >> >> The second step was another sed-based removal of subclass registration functions >> while also adding virtual functions from the base class into a class_init >> function as appropriate. >> >> Finally, a python script was used to convert the DeviceInfo structures and >> qdev_register_subclass functions to TypeInfo structures, class_init functions, >> and type_register_static calls. > > Can you document this process in enough detail so that those of us with > trees/branches not yet upstream can use it to ease the process of > rebasing after this lands, please? Replace DeviceInfo with TypeInfo, mapping: TypeInfo::name = DeviceInfo::name TypeInfo::parent = subclass argument to qdev_register_subclass TypeInfo::instance_size = DeviceInfo::size TypeInfo::class_init = DeviceInfo::class_init Any remaining DeviceInfo members being initialized should be moved to the class_init function as assignment to DeviceClass. Use DEVICE_CLASS() to case the ObjectClass in the argument to DeviceClass *dc and then assign the members. Replace qdev_register_subclass calls with type_register_static. Regards, Anthony Liguori > > Thanks > -- PMM >