[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/22] qdev: register all types natively through
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 09/22] qdev: register all types natively through QEMU Object Model |
Date: |
Thu, 02 Feb 2012 01:07:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0 |
Am 01.02.2012 20:50, schrieb Anthony Liguori:
> 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.
>
> We are almost fully converted to QOM after this commit.
>
> Signed-off-by: Anthony Liguori <address@hidden>
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[] = {
+ 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 = DEVICE_CLASS(klass);
ISADeviceClass *ic = ISA_DEVICE_CLASS(klass);
ic->init = rtc_initfn;
+ dc->no_user = 1;
+ dc->vmsd = &vmstate_rtc;
+ dc->props = mc146818rtc_properties;
}
- static DeviceInfo mc146818rtc_info = {
- .name = "mc146818rtc",
- .size = sizeof(RTCState),
- .no_user = 1,
- .vmsd = &vmstate_rtc,
- .class_init = rtc_class_initfn,
- .props = (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 = {
+ .name = "mc146818rtc",
+ .parent = TYPE_ISA_DEVICE,
+ .instance_size = sizeof(RTCState),
+ .class_init = rtc_class_initfn,
};
static void mc146818rtc_register(void)
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH 08/22] qdev: kill off DeviceInfo list, (continued)
- [Qemu-devel] [PATCH 08/22] qdev: kill off DeviceInfo list, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 10/22] qdev: kill off DeviceInfo, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 11/22] qdev: remove baked in notion of aliases (v2), Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 16/22] qdev: nuke qdev_init_chardev(), Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 15/22] qdev: split out UI portions into a new function, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 12/22] qom: add new command to search for types, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 17/22] qom: move properties from qdev to object, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 20/22] info qdm: do not require a parent_bus to be set, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 21/22] object: sure up reference counting, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 09/22] qdev: register all types natively through QEMU Object Model, Anthony Liguori, 2012/02/01
- Re: [Qemu-devel] [PATCH 09/22] qdev: register all types natively through QEMU Object Model,
Andreas Färber <=
- [Qemu-devel] [PATCH 22/22] container: make a decendent of Object, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 19/22] qdev: implement cleanup logic in finalize, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 07/22] qom: allow object_class_foreach to take additional parameters to refine search, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 14/22] qdev: refactor away qdev_create_from_info, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 13/22] qdev: split out common init to instance_init, Anthony Liguori, 2012/02/01
- [Qemu-devel] [PATCH 18/22] qom: accept any compatible type when setting a link property, Anthony Liguori, 2012/02/01
- Re: [Qemu-devel] [PATCH 00/22] qom: use Type system to register all devices (v2), Anthony Liguori, 2012/02/03