diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2015-05-21 12:43:31 +0200 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2015-09-07 16:10:43 +0200 |
commit | f6102c329c43d7d5e0bee1fc2fe4043e05f9810c (patch) | |
tree | 15be577d0766676a937fc2b7c34882fe8e75db49 /include | |
parent | 073f57ae347a41cbcc940ae0286bbbab993b9148 (diff) | |
download | qemu-f6102c329c43d7d5e0bee1fc2fe4043e05f9810c.zip |
s390/sclp: rework sclp event facility initialization + device realization
The current code only works by chance. The event facility is a sysbus
device, but specifies in its class structure as parent the DeviceClass
(instead of a device class).
The init function in return lies therefore at the same position as
the init function of SysBusDeviceClass and gets triggered instead -
a very bad idea of doing that (e.g. the parameter types don't match).
Let's bring the initialization code up to date, initializing the event
facility + child events in .instance_init and moving the realization of
the child events out of the init call, into the realization step.
Device realization is now automatically performed when the event facility
itself is realized. That realization implicitly triggers realization of
the child bus, which in turn initializes the events.
Please note that we have to manually propagate the realization of the bus
children, common code still has a TODO set for that task.
Reviewed-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/s390x/event-facility.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-facility.h index 871f3e7f11..eae3b3bd63 100644 --- a/include/hw/s390x/event-facility.h +++ b/include/hw/s390x/event-facility.h @@ -191,8 +191,7 @@ typedef struct SCLPEventClass { typedef struct SCLPEventFacility SCLPEventFacility; typedef struct SCLPEventFacilityClass { - DeviceClass parent_class; - int (*init)(SCLPEventFacility *ef); + SysBusDeviceClass parent_class; void (*command_handler)(SCLPEventFacility *ef, SCCB *sccb, uint64_t code); bool (*event_pending)(SCLPEventFacility *ef); } SCLPEventFacilityClass; |