aboutsummaryrefslogtreecommitdiff
path: root/xen-all.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-02-23 13:45:20 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-24 13:36:03 -0600
commitda98c8eb4c35225049cad8cf767647eb39788b5d (patch)
treeb6321ed36190de3ecf265ae4c5b25a2bfe54bb3e /xen-all.c
parent95b363b5c643d8ad81c5377726e753b84c909037 (diff)
suspend: switch acpi s3 to new infrastructure.
This patch switches pc s3 suspend over to the new infrastructure. The cmos_s3 qemu_irq is killed, the new notifier is used instead. The xen hack goes away with that too, the hypercall can simply be done in a notifier function now. This patch also makes the guest actually stay suspended instead of leaving suspend instantly, so it is useful for more than just testing whenever the suspend/resume cycle actually works. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'xen-all.c')
-rw-r--r--xen-all.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xen-all.c b/xen-all.c
index fd3916857c..b0ed1ed193 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -89,6 +89,7 @@ typedef struct XenIOState {
const XenPhysmap *log_for_dirtybit;
Notifier exit;
+ Notifier suspend;
} XenIOState;
/* Xen specific function for piix pci */
@@ -121,12 +122,9 @@ void xen_piix_pci_write_config_client(uint32_t address, uint32_t val, int len)
}
}
-void xen_cmos_set_s3_resume(void *opaque, int irq, int level)
+static void xen_suspend_notifier(Notifier *notifier, void *data)
{
- pc_cmos_set_s3_resume(opaque, irq, level);
- if (level) {
- xc_set_hvm_param(xen_xc, xen_domid, HVM_PARAM_ACPI_S_STATE, 3);
- }
+ xc_set_hvm_param(xen_xc, xen_domid, HVM_PARAM_ACPI_S_STATE, 3);
}
/* Xen Interrupt Controller */
@@ -936,6 +934,9 @@ int xen_hvm_init(void)
state->exit.notify = xen_exit_notifier;
qemu_add_exit_notifier(&state->exit);
+ state->suspend.notify = xen_suspend_notifier;
+ qemu_register_suspend_notifier(&state->suspend);
+
xc_get_hvm_param(xen_xc, xen_domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn);
DPRINTF("shared page at pfn %lx\n", ioreq_pfn);
state->shared_page = xc_map_foreign_range(xen_xc, xen_domid, XC_PAGE_SIZE,