Revision c804c2a7
b/hw/s390x/event-facility.c | ||
---|---|---|
377 | 377 |
.class_size = sizeof(SCLPEventFacilityClass), |
378 | 378 |
}; |
379 | 379 |
|
380 |
static int event_qdev_init(DeviceState *qdev)
|
|
380 |
static void event_realize(DeviceState *qdev, Error **errp)
|
|
381 | 381 |
{ |
382 |
SCLPEvent *event = DO_UPCAST(SCLPEvent, qdev, qdev);
|
|
382 |
SCLPEvent *event = SCLP_EVENT(qdev);
|
|
383 | 383 |
SCLPEventClass *child = SCLP_EVENT_GET_CLASS(event); |
384 | 384 |
|
385 |
return child->init(event); |
|
385 |
if (child->init) { |
|
386 |
int rc = child->init(event); |
|
387 |
if (rc < 0) { |
|
388 |
error_setg(errp, "SCLP event initialization failed."); |
|
389 |
return; |
|
390 |
} |
|
391 |
} |
|
386 | 392 |
} |
387 | 393 |
|
388 |
static int event_qdev_exit(DeviceState *qdev)
|
|
394 |
static void event_unrealize(DeviceState *qdev, Error **errp)
|
|
389 | 395 |
{ |
390 |
SCLPEvent *event = DO_UPCAST(SCLPEvent, qdev, qdev);
|
|
396 |
SCLPEvent *event = SCLP_EVENT(qdev);
|
|
391 | 397 |
SCLPEventClass *child = SCLP_EVENT_GET_CLASS(event); |
392 | 398 |
if (child->exit) { |
393 |
child->exit(event); |
|
399 |
int rc = child->exit(event); |
|
400 |
if (rc < 0) { |
|
401 |
error_setg(errp, "SCLP event exit failed."); |
|
402 |
return; |
|
403 |
} |
|
394 | 404 |
} |
395 |
return 0; |
|
396 | 405 |
} |
397 | 406 |
|
398 | 407 |
static void event_class_init(ObjectClass *klass, void *data) |
... | ... | |
401 | 410 |
|
402 | 411 |
dc->bus_type = TYPE_SCLP_EVENTS_BUS; |
403 | 412 |
dc->unplug = qdev_simple_unplug_cb; |
404 |
dc->init = event_qdev_init;
|
|
405 |
dc->exit = event_qdev_exit;
|
|
413 |
dc->realize = event_realize;
|
|
414 |
dc->unrealize = event_unrealize;
|
|
406 | 415 |
} |
407 | 416 |
|
408 | 417 |
static const TypeInfo sclp_event_type_info = { |
Also available in: Unified diff