]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
libxl: implement trigger s3resume
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 14 Feb 2011 16:49:03 +0000 (16:49 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 14 Feb 2011 16:49:03 +0000 (16:49 +0000)
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>
tools/libxl/libxl.c

index 1554d8824ac2c5f7f3c5366c8d8f7ce3bb4c8801..41db886bd0ff19a45385a2870d03b44d9b69696b 100644 (file)
@@ -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>");