diff options
author | Heinz Graalfs <graalfs@linux.vnet.ibm.com> | 2012-10-29 02:13:24 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-10-29 19:41:56 +0100 |
commit | ab9074b559823a22822db9e299198c53169c34ea (patch) | |
tree | 333d415a0e120152c087279d4bb45db0b6fcd59f /hw/s390x/event-facility.c | |
parent | 559a17a1439e34a95dcab47ef99022bcd0e8f8e7 (diff) |
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>
Diffstat (limited to 'hw/s390x/event-facility.c')
-rw-r--r-- | hw/s390x/event-facility.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index 1108e2d246..93676602a7 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -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; } |