All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxl: implement trigger s3resume
@ 2011-01-10 11:02 Stefano Stabellini
  2011-01-11 16:59 ` Ian Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Stabellini @ 2011-01-10 11:02 UTC (permalink / raw)
  To: xen-devel

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>

diff -r 1ae74f060a39 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Mon Jan 10 10:37:53 2011 +0000
+++ b/tools/libxl/libxl.c	Mon Jan 10 10:58:50 2011 +0000
@@ -2668,8 +2668,14 @@ static int trigger_type_from_string(char
 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>");

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libxl: implement trigger s3resume
  2011-01-10 11:02 [PATCH] libxl: implement trigger s3resume Stefano Stabellini
@ 2011-01-11 16:59 ` Ian Jackson
  2011-02-14 15:29   ` Stefano Stabellini
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Jackson @ 2011-01-11 16:59 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel

Stefano Stabellini writes ("[Xen-devel] [PATCH] libxl: implement trigger s3resume"):
> Implement trigger s3resume
> 
> This is the equivalent of xm trigger s3resume and it is implemented the
> same way: using an ACPI state change.

The code here is a bit odd - callers are apparently expected to pass
strings rather than enums through into the libxl API.  I think
trigger_type_from_string ought to be libxlu_...

But given the current code and the state of freeze we shouldn't do
that now.

This is clearly a low-impact new feature and I'm inclined to make
exception to the freeze for it.  Have you tested the patch ?  Anyone
object ?

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libxl: implement trigger s3resume
  2011-01-11 16:59 ` Ian Jackson
@ 2011-02-14 15:29   ` Stefano Stabellini
  2011-02-14 16:49     ` Ian Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Stabellini @ 2011-02-14 15:29 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel, Stefano Stabellini

On Tue, 11 Jan 2011, Ian Jackson wrote:
> Stefano Stabellini writes ("[Xen-devel] [PATCH] libxl: implement trigger s3resume"):
> > Implement trigger s3resume
> > 
> > This is the equivalent of xm trigger s3resume and it is implemented the
> > same way: using an ACPI state change.
> 
> The code here is a bit odd - callers are apparently expected to pass
> strings rather than enums through into the libxl API.  I think
> trigger_type_from_string ought to be libxlu_...
> 
> But given the current code and the state of freeze we shouldn't do
> that now.
> 
> This is clearly a low-impact new feature and I'm inclined to make
> exception to the freeze for it.  Have you tested the patch ?  Anyone
> object ?

I forgot to reply to this, but yes I tested it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libxl: implement trigger s3resume
  2011-02-14 15:29   ` Stefano Stabellini
@ 2011-02-14 16:49     ` Ian Jackson
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2011-02-14 16:49 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH] libxl: implement trigger s3resume"):
> I forgot to reply to this, but yes I tested it.

I've applied the patch, thanks.

Ian.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-14 16:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-10 11:02 [PATCH] libxl: implement trigger s3resume Stefano Stabellini
2011-01-11 16:59 ` Ian Jackson
2011-02-14 15:29   ` Stefano Stabellini
2011-02-14 16:49     ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.