aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2011-02-14 16:49:03 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2011-02-14 16:49:03 +0000
commit7a52b5c131faa242c9b37b60ef53b3a913c54520 (patch)
tree6f8731c597f99142ca1d77c1a13cf1b2ee08be77
parentf2cc80444550378a3b202242b2a090d20b5d7dab (diff)
downloadxen-7a52b5c131faa242c9b37b60ef53b3a913c54520.tar.gz
xen-7a52b5c131faa242c9b37b60ef53b3a913c54520.tar.bz2
xen-7a52b5c131faa242c9b37b60ef53b3a913c54520.zip
libxl: implement trigger s3resume
This is the equivalent of xm trigger s3resume and it is implemented the same way: using an ACPI state change. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--tools/libxl/libxl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 1554d8824a..41db886bd0 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2584,8 +2584,14 @@ static int trigger_type_from_string(char *trigger_name)
int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid, char *trigger_name, uint32_t vcpuid)
{
int rc = -1;
- int trigger_type = trigger_type_from_string(trigger_name);
+ int trigger_type = -1;
+ if (!strcmp(trigger_name, "s3resume")) {
+ xc_set_hvm_param(ctx->xch, domid, HVM_PARAM_ACPI_S_STATE, 0);
+ return 0;
+ }
+
+ trigger_type = trigger_type_from_string(trigger_name);
if (trigger_type == -1) {
LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, -1,
"Invalid trigger, valid triggers are <nmi|reset|init|power|sleep>");