aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/xen/control
diff options
context:
space:
mode:
authorRoger Pau Monné <royger@FreeBSD.org>2017-03-07 09:16:51 +0000
committerRoger Pau Monné <royger@FreeBSD.org>2017-03-07 09:16:51 +0000
commit8dee0e9bd64849deca80da9052c806e764ef026c (patch)
tree8a90eb2b376d4cfc1722f58a22b0ec4bf0f7b581 /sys/dev/xen/control
parentacd63c37d6702be2ca95b55e5d62baff86c97f71 (diff)
Notes
Diffstat (limited to 'sys/dev/xen/control')
-rw-r--r--sys/dev/xen/control/control.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c
index ae13c6c10078..d4249886332b 100644
--- a/sys/dev/xen/control/control.c
+++ b/sys/dev/xen/control/control.c
@@ -148,6 +148,7 @@ __FBSDID("$FreeBSD$");
#include <xen/xenbus/xenbusvar.h>
+bool xen_suspend_cancelled;
/*--------------------------- Forward Declarations --------------------------*/
/** Function signature for shutdown event handlers. */
typedef void (xctrl_shutdown_handler_t)(void);
@@ -196,7 +197,6 @@ xctrl_suspend()
#ifdef SMP
cpuset_t cpu_suspend_map;
#endif
- int suspend_cancelled;
EVENTHANDLER_INVOKE(power_suspend_early);
stop_all_proc();
@@ -267,16 +267,20 @@ xctrl_suspend()
intr_suspend();
xen_hvm_suspend();
- suspend_cancelled = HYPERVISOR_suspend(0);
+ xen_suspend_cancelled = !!HYPERVISOR_suspend(0);
- xen_hvm_resume(suspend_cancelled != 0);
- intr_resume(suspend_cancelled != 0);
+ if (!xen_suspend_cancelled) {
+ xen_hvm_resume(false);
+ }
+ intr_resume(xen_suspend_cancelled != 0);
enable_intr();
/*
* Reset grant table info.
*/
- gnttab_resume(NULL);
+ if (!xen_suspend_cancelled) {
+ gnttab_resume(NULL);
+ }
#ifdef SMP
if (!CPU_EMPTY(&cpu_suspend_map)) {