From: Dario Faggioli Date: Fri, 17 Jun 2016 10:31:00 +0000 (+0200) Subject: xen: sched: use default scheduler upon an invalid "sched=" X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~914 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9dec2c47406f4ef31711656722f5f70d758d6160;p=xen.git xen: sched: use default scheduler upon an invalid "sched=" instead of just the first scheduler we find in the array. In fact, right now, if someone makes a typo when passing the "sched=" command line option to Xen, we (with all schedulers configured in) pick ARINC653, which is most likely not what one would expect. Go for the default scheduler instead. Signed-off-by: Dario Faggioli Acked-by: George Dunlap Reviewed-by: Andrew Cooper Reviewed-By: Jonathan Creekmore --- diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 5e35310411..7ac12d3dfc 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -1625,7 +1625,8 @@ void __init scheduler_init(void) { printk("Could not find scheduler: %s\n", opt_sched); for ( i = 0; i < NUM_SCHEDULERS; i++ ) - if ( schedulers[i] ) + if ( schedulers[i] && + !strcmp(schedulers[i]->opt_name, CONFIG_SCHED_DEFAULT) ) { ops = *schedulers[i]; break;