s390: sclp signal quiesce support

This implements the sclp signal quiesce event via the SCLP Event
Facility.
This allows to gracefully shutdown a guest by using system_powerdown
notifiers. It creates a service interrupt that will trigger a
Read Event Data command from the guest. This code will then add an
event that is interpreted by linux guests as ctrl-alt-del.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Heinz Graalfs 2012-10-29 02:13:24 +00:00 committed by Alexander Graf
parent 559a17a143
commit ab9074b559
3 changed files with 131 additions and 0 deletions

View file

@ -315,6 +315,7 @@ static void command_handler(SCLPEventFacility *ef, SCCB *sccb, uint64_t code)
static int init_event_facility(S390SCLPDevice *sdev)
{
SCLPEventFacility *event_facility;
DeviceState *quiesce;
event_facility = g_malloc0(sizeof(SCLPEventFacility));
sdev->ef = event_facility;
@ -327,6 +328,12 @@ static int init_event_facility(S390SCLPDevice *sdev)
event_facility->sbus.qbus.allow_hotplug = 0;
event_facility->qdev = (DeviceState *) sdev;
quiesce = qdev_create(&event_facility->sbus.qbus, "sclpquiesce");
if (!quiesce) {
return -1;
}
qdev_init_nofail(quiesce);
return 0;
}