aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2012-03-22 12:20:13 +0000
committerKeir Fraser <keir@xen.org>2012-03-22 12:20:13 +0000
commit269f543ea750ed567d18f2e819e5d5ce58eda5c5 (patch)
treef1bfaca66eeec018fa55f65817fa387ca62c082f /xen/common
parent8aed7f047dacebfe8c28109b7adb55784e5bc8ef (diff)
downloadxen-269f543ea750ed567d18f2e819e5d5ce58eda5c5.tar.gz
xen-269f543ea750ed567d18f2e819e5d5ce58eda5c5.tar.bz2
xen-269f543ea750ed567d18f2e819e5d5ce58eda5c5.zip
Introduce system_state variable.
Use it to replace x86-specific early_boot boolean variable. Also use it to detect suspend/resume case during cpu offline/online to avoid unnecessarily breaking vcpu and cpupool affinities. Signed-off-by: Keir Fraser <keir@xen.org> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Diffstat (limited to 'xen/common')
-rw-r--r--xen/common/cpupool.c5
-rw-r--r--xen/common/kernel.c2
-rw-r--r--xen/common/schedule.c2
3 files changed, 8 insertions, 1 deletions
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 6cef4a003e..c9cc123a40 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -629,6 +629,10 @@ static int cpu_callback(
unsigned int cpu = (unsigned long)hcpu;
int rc = 0;
+ if ( (system_state == SYS_STATE_suspend) ||
+ (system_state == SYS_STATE_resume) )
+ goto out;
+
switch ( action )
{
case CPU_DOWN_FAILED:
@@ -642,6 +646,7 @@ static int cpu_callback(
break;
}
+out:
return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
}
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 88984d2355..1679dbb4f2 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -20,6 +20,8 @@
#ifndef COMPAT
+enum system_state system_state = SYS_STATE_early_boot;
+
int tainted;
xen_commandline_t saved_cmdline;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 24f89467a1..a1eeac36eb 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -538,7 +538,7 @@ int cpu_disable_scheduler(unsigned int cpu)
int ret = 0;
c = per_cpu(cpupool, cpu);
- if ( c == NULL )
+ if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
return ret;
for_each_domain_in_cpupool ( d, c )