> On 15 Feb 2022, at 10:40, Juergen Gross <jgross@suse.com> wrote:
>
> On 15.02.22 11:15, Luca Fancellu wrote:
>> Add a public function to retrieve the scheduler id by the scheduler
>> name.
>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>> ---
>> xen/common/sched/core.c | 11 +++++++++++
>> xen/include/xen/sched.h | 11 +++++++++++
>> 2 files changed, 22 insertions(+)
>> diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
>> index 8f4b1ca10d1c..9696d3c1d769 100644
>> --- a/xen/common/sched/core.c
>> +++ b/xen/common/sched/core.c
>> @@ -2947,6 +2947,17 @@ void scheduler_enable(void)
>> scheduler_active = true;
>> }
>> +int __init sched_get_id_by_name(const char *sched_name)
>> +{
>> + unsigned int i;
>> +
>> + for ( i = 0; i < NUM_SCHEDULERS; i++ )
>> + if ( schedulers[i] && !strcmp(schedulers[i]->opt_name, sched_name) )
>> + return schedulers[i]->sched_id;
>> +
>> + return -1;
>> +}
>> +
>
> Please make use of this function in scheduler_init(), as this
> functionality is open coded there, too.
>
Ok I will change the code in scheduler_init to use the new function.
Cheers,
Luca
>
> Juergen
> <OpenPGP_0xB0DE9DD628BF132F.asc>