Signed-off-by: juergen.gross@xxxxxxxxxxxxxx diff -r efa1b905d893 xen/common/cpupool.c --- a/xen/common/cpupool.c Tue May 04 13:59:55 2010 +0100 +++ b/xen/common/cpupool.c Wed May 05 13:01:32 2010 +0200 @@ -37,6 +37,7 @@ * as it was obtained! */ static DEFINE_SPINLOCK(cpupool_lock); +static DEFINE_SPINLOCK(cpupool_ctl_lock); DEFINE_PER_CPU(struct cpupool *, cpupool); @@ -401,6 +402,8 @@ int ret; struct cpupool *c; + spin_lock(&cpupool_ctl_lock); + switch ( op->op ) { @@ -426,9 +429,7 @@ case XEN_DOMCTL_CPUPOOL_OP_DESTROY: { - spin_lock(&cpupool_lock); c = cpupool_find_by_id(op->cpupool_id, 1); - spin_unlock(&cpupool_lock); ret = -ENOENT; if ( c == NULL ) break; @@ -438,9 +439,7 @@ case XEN_DOMCTL_CPUPOOL_OP_INFO: { - spin_lock(&cpupool_lock); c = cpupool_find_by_id(op->cpupool_id, 0); - spin_unlock(&cpupool_lock); ret = -ENOENT; if ( c == NULL ) break; @@ -484,9 +483,7 @@ { unsigned cpu; - spin_lock(&cpupool_lock); c = cpupool_find_by_id(op->cpupool_id, 0); - spin_unlock(&cpupool_lock); ret = -ENOENT; if ( c == NULL ) break; @@ -560,6 +557,8 @@ } + spin_unlock(&cpupool_ctl_lock); + return ret; }