From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RskFP-0004bv-LN for qemu-devel@nongnu.org; Wed, 01 Feb 2012 19:09:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RskFO-0007Gi-Ep for qemu-devel@nongnu.org; Wed, 01 Feb 2012 19:09:55 -0500 Received: from cantor2.suse.de ([195.135.220.15]:47013 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RskFO-0007Fm-6g for qemu-devel@nongnu.org; Wed, 01 Feb 2012 19:09:54 -0500 Message-ID: <4F29D3C1.9090902@suse.de> Date: Thu, 02 Feb 2012 01:07:29 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1328125863-6203-1-git-send-email-aliguori@us.ibm.com> <1328125863-6203-10-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1328125863-6203-10-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 09/22] qdev: register all types natively through QEMU Object Model List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , qemu-devel@nongnu.org, Peter Maydell Am 01.02.2012 20:50, schrieb Anthony Liguori: > This was done in a mostly automated fashion. I did it in three steps a= nd then > rebased it into a single step which avoids repeatedly touching every fi= le in > the tree. >=20 > The first step was a sed-based addition of the parent type to the subcl= ass > registration functions. >=20 > The second step was another sed-based removal of subclass registration = functions > while also adding virtual functions from the base class into a class_in= it > function as appropriate. >=20 > Finally, a python script was used to convert the DeviceInfo structures = and > qdev_register_subclass functions to TypeInfo structures, class_init fun= ctions, > and type_register_static calls. >=20 > We are almost fully converted to QOM after this commit. >=20 > Signed-off-by: Anthony Liguori Doesn't apply any more due to new lost_tick_policy property. Andreas diff --cc hw/mc146818rtc.c index e6e4cb7,c1f4ef4..0000000 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@@ -709,24 -699,26 +709,28 @@@ ISADevice *rtc_init(ISABus *bus, int ba return dev; } + static Property mc146818rtc_properties[] =3D { + DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980), ++ DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState, ++ lost_tick_policy, LOST_TICK_DISCARD), + DEFINE_PROP_END_OF_LIST(), + }; + static void rtc_class_initfn(ObjectClass *klass, void *data) { + DeviceClass *dc =3D DEVICE_CLASS(klass); ISADeviceClass *ic =3D ISA_DEVICE_CLASS(klass); ic->init =3D rtc_initfn; + dc->no_user =3D 1; + dc->vmsd =3D &vmstate_rtc; + dc->props =3D mc146818rtc_properties; } - static DeviceInfo mc146818rtc_info =3D { - .name =3D "mc146818rtc", - .size =3D sizeof(RTCState), - .no_user =3D 1, - .vmsd =3D &vmstate_rtc, - .class_init =3D rtc_class_initfn, - .props =3D (Property[]) { - DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980), - DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState, - lost_tick_policy, LOST_TICK_DISCARD)= , - DEFINE_PROP_END_OF_LIST(), - } + static TypeInfo mc146818rtc_info =3D { + .name =3D "mc146818rtc", + .parent =3D TYPE_ISA_DEVICE, + .instance_size =3D sizeof(RTCState), + .class_init =3D rtc_class_initfn, }; static void mc146818rtc_register(void) --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg