xen: suspend: use HYPERVISOR_suspend for PVHVM case instead of open coding

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
Ian Campbell 2011-02-17 11:04:20 +00:00 коммит произвёл Stefano Stabellini
Родитель a8b7458363
Коммит bd1c0ad284
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -38,7 +38,6 @@ static enum shutdown_state shutting_down = SHUTDOWN_INVALID;
static int xen_hvm_suspend(void *data) static int xen_hvm_suspend(void *data)
{ {
int err; int err;
struct sched_shutdown r = { .reason = SHUTDOWN_suspend };
int *cancelled = data; int *cancelled = data;
BUG_ON(!irqs_disabled()); BUG_ON(!irqs_disabled());
@ -50,7 +49,12 @@ static int xen_hvm_suspend(void *data)
return err; 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); xen_hvm_post_suspend(*cancelled);
gnttab_resume(); gnttab_resume();