xen: suspend: use HYPERVISOR_suspend for PVHVM case instead of open coding
authorIan Campbell <ian.campbell@citrix.com>
Thu, 17 Feb 2011 11:04:20 +0000 (11:04 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 25 Feb 2011 16:43:11 +0000 (16:43 +0000)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/manage.c

index 972bf78..4dd0186 100644 (file)
@@ -38,7 +38,6 @@ static enum shutdown_state shutting_down = SHUTDOWN_INVALID;
 static int xen_hvm_suspend(void *data)
 {
        int err;
-       struct sched_shutdown r = { .reason = SHUTDOWN_suspend };
        int *cancelled = data;
 
        BUG_ON(!irqs_disabled());
@@ -50,7 +49,12 @@ static int xen_hvm_suspend(void *data)
                return err;
        }
 
-       *cancelled = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
+       /*
+        * This hypercall returns 1 if suspend was cancelled
+        * or the domain was merely checkpointed, and 0 if it
+        * is resuming in a new domain.
+        */
+       *cancelled = HYPERVISOR_suspend(0UL);
 
        xen_hvm_post_suspend(*cancelled);
        gnttab_resume();