mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
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:
parent
559a17a143
commit
ab9074b559
3 changed files with 131 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue