libxl: libxl_domain_sched_params_set case for ARINC 653 scheduler
PATCH 1/1 libxl: libxl_domain_sched_params_set case for ARINC 653 scheduler
Implements sched_arinc653_domain_set to match the existing API. Currently, there is no domain-specific configuration when using the ARINC 653 scheduler, so we simply return success.
tools/libxl/libxl.c +11 -0
@@ -3642,6 +3642,14 @@ libxl_scheduler libxl_get_scheduler(libxreturn sched; } +static int sched_arinc653_domain_set (libxl__gc *gc,uint32_t domid, +const libxl_domain_sched_params *scinfo) +{ +// Currently, the ARINC 653 scheduler does not take any domain-specific +// configuration, so we simply return success. +return 0 ; +} +static int sched_credit_domain_get (libxl__gc *gc,uint32_t domid,libxl_domain_sched_params *scinfo) {
@@ -3909,6 +3917,9 @@ int libxl_domain_sched_params_set(libxl_case LIBXL_SCHEDULER_CREDIT2 : ret=sched_credit2_domain_set (gc, domid, scinfo);break ; +case LIBXL_SCHEDULER_ARINC653 : + ret=sched_arinc653_domain_set (gc, domid, scinfo); +break ;default :LOG (ERROR ,"Unknown scheduler" ); ret=ERROR_INVAL ;
Hi Andrew,
Quoted 4 lines · Andrew Kane
Implements
sched_arinc653_domain_setto match the existing API. Currently, there is no domain-specific configuration when using the ARINC 653 scheduler, so we simply return success.
Cool, thanks for doing this. I've only a small question...
tools/libxl/libxl.c libxl_scheduler libxl_get_scheduler(libx · line 3650
Quoted 13 lines
diff -r
4a28c496acbf-r857a035d6a4atools/libxl/libxl.ctools/libxl/libxl.c +5
-0@@ -3642,6 +3642,14 @@ libxl_scheduler libxl_get_scheduler(libxreturn sched; } +static int sched_arinc653_domain_set (libxl__gc *gc,uint32_t domid, +const libxl_domain_sched_params *scinfo) +{ +// Currently, the ARINC 653 scheduler does not take any domain-specific +// configuration, so we simply return success.
I think using C (/* */) style for comment is highly recommended, if not required. :-)
tools/libxl/libxl.c libxl_scheduler libxl_get_scheduler(libx
Quoted 4 lines
tools/libxl/libxl.c +3
-0+return 0 ; +} +
It's certainly not a bit deal, and the compiler might be doing this on its own already but, as the function doesn't actually do anything, why not putting the comment down in the switch [*]?
That way we still avoid LIBXL_SCHEDULING_ARNIC653 being caught by the
default: clause and resulting in an error, but without introducing an empty function that might look confusing.
If in future there will be the need for a specific sched_arnic653_domain_set function, we can add it then.
tools/libxl/libxl.c int libxl_domain_sched_params_set(libxl_ · line 3923
Quoted 11 lines
tools/libxl/libxl.c +0
-0static int sched_credit_domain_get(libxl__gc *gc, uint32_t domid,
libxl_domain_sched_params*scinfo)
{tools/libxl/libxl.c +3
-0@@ -3909,6 +3917,9 @@ int libxl_domain_sched_params_set(libxl_case LIBXL_SCHEDULER_CREDIT2 : ret=sched_credit2_domain_set (gc, domid, scinfo);break ; +case LIBXL_SCHEDULER_ARINC653 : + ret=sched_arinc653_domain_set (gc, domid, scinfo); +break ;
[*] I mean right here... :-)
Quoted 4 lines
default:
LOG(ERROR, "Unknown scheduler"); ret=ERROR_INVAL;
Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Dario,
Quoted 16 lines · Dario Faggioli
Hi Andrew,
Quoted 4 lines · Andrew Kane
Implements
sched_arinc653_domain_setto match the existing API. Currently, there is no domain-specific configuration when using the ARINC 653 scheduler, so we simply return success.Cool, thanks for doing this. I've only a small question...
Quoted 7 lines
diff -r
4a28c496acbf-r857a035d6a4atools/libxl/libxl.ctools/libxl/libxl.c +0
-0@@ -3642,6 +3642,14 @@ libxl_scheduler libxl_get_scheduler(libxreturn sched; }
Quoted 8 lines
tools/libxl/libxl.c libxl_scheduler libxl_get_scheduler(libx
Quoted 6 lines
tools/libxl/libxl.c +5
-0+static int sched_arinc653_domain_set (libxl__gc *gc,uint32_t domid, +const libxl_domain_sched_params *scinfo) +{ +// Currently, the ARINC 653 scheduler does not take any domain-specific +// configuration, so we simply return success. I think using C (/* */) style for comment is highly recommended, if not required. :-)
Oops. That's what I get for trusting the editor with comments. =)
Quoted 9 lines
tools/libxl/libxl.c libxl_scheduler libxl_get_scheduler(libx
Quoted 5 lines
tools/libxl/libxl.c +3
-0+return 0 ; +} +It's certainly not a bit deal, and the compiler might be doing this on its own already but, as the function doesn't actually do anything, why not putting the comment down in the switch [*]?
Quoted 6 lines
That way we still avoid
LIBXL_SCHEDULING_ARNIC653being caught by the
default: clause and resulting in an error, but without introducing an empty function that might look confusing.If in future there will be the need for a specific
sched_arnic653_domain_setfunction, we can add it then.
Our thought was to define this following the structure that exists for the other schedulers, both for consistency and to facilitate future work on the ARINC 653 scheduler.
If/when we actually need domain-specific configuration like this, it would only involve changes in the sched_arinc653_domain_set function, and wouldn't require any changes to libxl_domain_sched_params_set.
If the preference is to hold off on implementing a sched_arinc653_domain_set function until there's actually something to put in it, I'm happy to change it. =)
Quoted 14 lines
tools/libxl/libxl.c int libxl_domain_sched_params_set(libxl_ · line 3923
Quoted 12 lines
tools/libxl/libxl.c +0
-0static int sched_credit_domain_get(libxl__gc *gc, uint32_t domid,
libxl_domain_sched_params*scinfo)
{tools/libxl/libxl.c +3
-0@@ -3909,6 +3917,9 @@ int libxl_domain_sched_params_set(libxl_case LIBXL_SCHEDULER_CREDIT2 : ret=sched_credit2_domain_set (gc, domid, scinfo);break ; +case LIBXL_SCHEDULER_ARINC653 : + ret=sched_arinc653_domain_set (gc, domid, scinfo); +break ;[*] I mean right here... :-)
Quoted 14 lines
Quoted 4 lines
default:
LOG(ERROR, "Unknown scheduler"); ret=ERROR_INVAL;Regards,
DarioSignature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
Regards,
- Andrew
Signature · 2 lines
Andrew Kane Computer Engineering Intern, DornerWorks Ltd.
Quoted 11 lines · Andrew Kane
Quoted 8 lines
tools/libxl/libxl.c libxl_scheduler libxl_get_scheduler(libx · line 3649
Quoted 6 lines
tools/libxl/libxl.c +5
-0+static int sched_arinc653_domain_set (libxl__gc *gc,uint32_t domid, +const libxl_domain_sched_params *scinfo) +{ +// Currently, the ARINC 653 scheduler does not take any domain-specific +// configuration, so we simply return success. I think using C (/* */) style for comment is highly recommended, if not required. :-)
Oops. That's what I get for trusting the editor with comments. =)
:-)
Quoted 4 lines
Our thought was to define this following the structure that exists for the other schedulers, both for consistency and to facilitate future work on the ARINC 653 scheduler.
Yeah, I got that, and it's not bad thinking actually.
Thinking a bit more about this, right below libxl_domain_sched_params_set() (in libxl.c) there is another function called libxl_domain_sched_params_get(), doing pretty much the same thing, although of course it retrieves instead of setting.
Shouldn't you be doing something similar to that too?
Quoted 9 lines
If/when we actually need domain-specific configuration like this, it would only involve changes in the
sched_arinc653_domain_setfunction, and wouldn't require any changes tolibxl_domain_sched_params_set.If the preference is to hold off on implementing a
sched_arinc653_domain_setfunction until there's actually something to put in it, I'm happy to change it. =)
It's mostly a matter of taste I guess.
The way I pointed is my preference, but I really don't care that much. If you send a patch with proper commenting (and perhaps dealing with the *_get() path), I'll ack it no matter if you have those empty functions or not... Which will then mean it'll be up to Goerge and Ian (added to the Cc list) to decide what they like better. :-)
Thanks and Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 36 lines · Dario Faggioli
Quoted 11 lines · Andrew Kane
Quoted 8 lines
tools/libxl/libxl.c libxl_scheduler libxl_get_scheduler(libx · line 3649
Quoted 6 lines
tools/libxl/libxl.c +5
-0+static int sched_arinc653_domain_set (libxl__gc *gc,uint32_t domid, +const libxl_domain_sched_params *scinfo) +{ +// Currently, the ARINC 653 scheduler does not take any domain-specific +// configuration, so we simply return success. I think using C (/* */) style for comment is highly recommended, if not required. :-)
Oops. That's what I get for trusting the editor with comments. =)
:-)
Quoted 4 lines
Our thought was to define this following the structure that exists for the other schedulers, both for consistency and to facilitate future work on the ARINC 653 scheduler.
Yeah, I got that, and it's not bad thinking actually.
Thinking a bit more about this, right below
libxl_domain_sched_params_set()(inlibxl.c) there is another function calledlibxl_domain_sched_params_get(), doing pretty much the same thing, although of course it retrieves instead of setting.Shouldn't you be doing something similar to that too?
Quoted 9 lines
If/when we actually need domain-specific configuration like this, it would only involve changes in the
sched_arinc653_domain_setfunction, and wouldn't require any changes tolibxl_domain_sched_params_set.If the preference is to hold off on implementing a
sched_arinc653_domain_setfunction until there's actually something to put in it, I'm happy to change it. =)
Quoted 7 lines
It's mostly a matter of taste I guess.
The way I pointed is my preference, but I really don't care that much. If you send a patch with proper commenting (and perhaps dealing with the
*_get()path), I'll ack it no matter if you have those empty functions or not... Which will then mean it'll be up to Goerge and Ian (added to the Cc list) to decide what they like better. :-)
I'm happy with whichever style Andrew as author can be bothered to type in ;-)
Ian.
Quoted 4 lines
Thanks and Regards,
Dario
Quoted 35 lines · Dario Faggioli
Quoted 10 lines · Andrew Kane
Quoted 8 lines
tools/libxl/libxl.c libxl_scheduler libxl_get_scheduler(libx · line 3649
Quoted 6 lines
tools/libxl/libxl.c +5
-0+static int sched_arinc653_domain_set (libxl__gc *gc,uint32_t domid, +const libxl_domain_sched_params *scinfo) +{ +// Currently, the ARINC 653 scheduler does not take any domain-specific +// configuration, so we simply return success. I think using C (/* */) style for comment is highly recommended, if not required. :-)
Oops. That's what I get for trusting the editor with comments. =)
:-)
Quoted 4 lines
Our thought was to define this following the structure that exists for the other schedulers, both for consistency and to facilitate future work on the ARINC 653 scheduler.
Yeah, I got that, and it's not bad thinking actually.
Thinking a bit more about this, right below
libxl_domain_sched_params_set()(inlibxl.c) there is another function calledlibxl_domain_sched_params_get(), doing pretty much the same thing, although of course it retrieves instead of setting.Shouldn't you be doing something similar to that too?
Quoted 9 lines
If/when we actually need domain-specific configuration like this, it would only involve changes in the
sched_arinc653_domain_setfunction, and wouldn't require any changes tolibxl_domain_sched_params_set.If the preference is to hold off on implementing a
sched_arinc653_domain_setfunction until there's actually something to put in it, I'm happy to change it. =)
Quoted 7 lines
It's mostly a matter of taste I guess.
The way I pointed is my preference, but I really don't care that much. If you send a patch with proper commenting (and perhaps dealing with the
*_get()path), I'll ack it no matter if you have those empty functions or not... Which will then mean it'll be up to Goerge and Ian (added to the Cc list) to decide what they like better. :-)
Yeah, the comment needs to be changed to C-style, but I don't think calling a function or not is worth the trouble of talking about. :-)
-George