libxl: set correct credit cpu weight, when no one is specified in the config file all default values have to be set to 0, but for the credit(2) scheduler cpu_weight has to be 256 by default. So if the weight isn't given in the confgfile we use 256 for the credit(2) scheduler and 0 for sedf Signed-off-by: Dieter Bloms diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index c246211..ec2e3af 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -62,12 +62,18 @@ int libxl__sched_set_params(libxl__gc *gc, uint32_t domid, libxl_sched_params *s ret=libxl_sched_sedf_domain_set(ctx, domid, &sedf_info); break; case LIBXL_SCHEDULER_CREDIT: - credit_info.weight = scparams->weight; + if (scparams->weight) + credit_info.weight = scparams->weight; + else + credit_info.weight = 256; credit_info.cap = scparams->cap; ret=libxl_sched_credit_domain_set(ctx, domid, &credit_info); break; case LIBXL_SCHEDULER_CREDIT2: - credit2_info.weight = scparams->weight; + if (scparams->weight) + credit2_info.weight = scparams->weight; + else + credit_info.weight = 256; ret=libxl_sched_credit2_domain_set(ctx, domid, &credit2_info); break; default: