# HG changeset patch # User Juergen Gross # Date 1297148261 -3600 # Node ID e5e8d2c42e759a8eabddcca0fab548a9fc9f6b8a # Parent 9e463cb156586bfd50b8123664f1c290ca9f1f98 Strict parameter checking for cpupool operations Some cpupool actions didn't check the cpupool_id exactly. For some actions this doesn't make any sense, so refuse those actions if the specified cpupool doesn't exist. Signed-off-by: juergen.gross@xxxxxxxxxxxxxx diff -r 9e463cb15658 -r e5e8d2c42e75 xen/common/cpupool.c --- a/xen/common/cpupool.c Mon Feb 07 17:02:46 2011 +0000 +++ b/xen/common/cpupool.c Tue Feb 08 07:57:41 2011 +0100 @@ -485,7 +485,7 @@ int cpupool_do_sysctl(struct xen_sysctl_ ret = -EBUSY; if ( !cpu_isset(cpu, cpupool_free_cpus) ) goto addcpu_out; - c = cpupool_find_by_id(op->cpupool_id, 0); + c = cpupool_find_by_id(op->cpupool_id, 1); ret = -ENOENT; if ( c == NULL ) goto addcpu_out; @@ -501,7 +501,7 @@ int cpupool_do_sysctl(struct xen_sysctl_ { unsigned cpu; - c = __cpupool_get_by_id(op->cpupool_id, 0); + c = __cpupool_get_by_id(op->cpupool_id, 1); ret = -ENOENT; if ( c == NULL ) break;