mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
spapr/xive: Use device_class_set_parent_realize()
The XIVE router base class currently inherits an empty realize hook from the sysbus device base class, but it will soon implement one of its own to perform some sanity checks. Do the preliminary plumbing to have it called. Signed-off-by: Greg Kurz <groug@kaod.org> Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20191219181155.32530-6-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
068fe58cf9
commit
6cc64796f2
2 changed files with 21 additions and 1 deletions
|
@ -286,10 +286,17 @@ static void spapr_xive_instance_init(Object *obj)
|
|||
static void spapr_xive_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
SpaprXive *xive = SPAPR_XIVE(dev);
|
||||
SpaprXiveClass *sxc = SPAPR_XIVE_GET_CLASS(xive);
|
||||
XiveSource *xsrc = &xive->source;
|
||||
XiveENDSource *end_xsrc = &xive->end_source;
|
||||
Error *local_err = NULL;
|
||||
|
||||
sxc->parent_realize(dev, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!xive->nr_irqs) {
|
||||
error_setg(errp, "Number of interrupt needs to be greater 0");
|
||||
return;
|
||||
|
@ -760,10 +767,12 @@ static void spapr_xive_class_init(ObjectClass *klass, void *data)
|
|||
XiveRouterClass *xrc = XIVE_ROUTER_CLASS(klass);
|
||||
SpaprInterruptControllerClass *sicc = SPAPR_INTC_CLASS(klass);
|
||||
XivePresenterClass *xpc = XIVE_PRESENTER_CLASS(klass);
|
||||
SpaprXiveClass *sxc = SPAPR_XIVE_CLASS(klass);
|
||||
|
||||
dc->desc = "sPAPR XIVE Interrupt Controller";
|
||||
dc->props = spapr_xive_properties;
|
||||
dc->realize = spapr_xive_realize;
|
||||
device_class_set_parent_realize(dc, spapr_xive_realize,
|
||||
&sxc->parent_realize);
|
||||
dc->vmsd = &vmstate_spapr_xive;
|
||||
|
||||
xrc->get_eas = spapr_xive_get_eas;
|
||||
|
@ -794,6 +803,7 @@ static const TypeInfo spapr_xive_info = {
|
|||
.instance_init = spapr_xive_instance_init,
|
||||
.instance_size = sizeof(SpaprXive),
|
||||
.class_init = spapr_xive_class_init,
|
||||
.class_size = sizeof(SpaprXiveClass),
|
||||
.interfaces = (InterfaceInfo[]) {
|
||||
{ TYPE_SPAPR_INTC },
|
||||
{ }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue