s390/sclp: rework sclp event facility initialization + device realization
commitf6102c329c43d7d5e0bee1fc2fe4043e05f9810c
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Thu, 21 May 2015 10:43:31 +0000 (21 12:43 +0200)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Mon, 7 Sep 2015 14:10:43 +0000 (7 16:10 +0200)
tree15be577d0766676a937fc2b7c34882fe8e75db49
parent073f57ae347a41cbcc940ae0286bbbab993b9148
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>
hw/s390x/event-facility.c
include/hw/s390x/event-facility.h