From: Dario Faggioli <raistlin@linux.it>
To: xen-devel@lists.xen.orgxen-devel@lists.xen.org
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
Juergen Gross <juergen.gross@ts.fujitsu.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <Ian.Campbell@citrix.com>
Subject: [PATCH] xl: check for meaningful combination of sedf config file parameters
Date: Mon, 04 Jun 2012 16:01:23 +0200 [thread overview]
Message-ID: <3eadab19abd49fbc6f56.1338818483@Solace> (raw)
As we do it in the implementation of `xl sched-sedf -d ...', some
consistency checking is needed while parsing the sedf scheduling
parameters provided via config file. Not doing this results in the call
libxl_domain_sched_params_set() to fail, and no parameters being
enforced for the domain.
Note we do this at config file parsing time as that gives us the chance
of bailing out early. It would have been pointless to add it within
sched_sedf_domain_set() (in libxl), as the very same thing is
done in the hypervisor, and the result is being checked and returned
to the caller already.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -561,6 +561,7 @@ static void parse_config_data(const char
long l;
XLU_Config *config;
XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids;
+ int opt_w = 0, opt_p = 0, opt_s = 0;
int pci_power_mgmt = 0;
int pci_msitranslate = 1;
int pci_permissive = 0;
@@ -632,18 +633,36 @@ static void parse_config_data(const char
/* the following is the actual config parsing with overriding
* values in the structures */
- if (!xlu_cfg_get_long (config, "cpu_weight", &l, 0))
+ if (!xlu_cfg_get_long (config, "cpu_weight", &l, 0)) {
b_info->sched_params.weight = l;
+ opt_w = 1;
+ }
if (!xlu_cfg_get_long (config, "cap", &l, 0))
b_info->sched_params.cap = l;
- if (!xlu_cfg_get_long (config, "period", &l, 0))
+ if (!xlu_cfg_get_long (config, "period", &l, 0)) {
b_info->sched_params.period = l;
- if (!xlu_cfg_get_long (config, "slice", &l, 0))
+ opt_p = 1;
+ }
+ if (!xlu_cfg_get_long (config, "slice", &l, 0)) {
b_info->sched_params.slice = l;
+ opt_s = 1;
+ }
if (!xlu_cfg_get_long (config, "latency", &l, 0))
b_info->sched_params.latency = l;
if (!xlu_cfg_get_long (config, "extratime", &l, 0))
b_info->sched_params.extratime = l;
+ /* The sedf scheduler needs some more consistency checking */
+ if (opt_w && (opt_p || opt_s)) {
+ fprintf(stderr, "Either specify a weight OR a period and slice\n");
+ exit(1);
+ }
+ if (opt_w) {
+ b_info->sched_params.slice = 0;
+ b_info->sched_params.period = 0;
+ }
+ if (opt_p || opt_s)
+ b_info->sched_params.weight = 0;
+
if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
b_info->max_vcpus = l;
next reply other threads:[~2012-06-04 14:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 14:01 Dario Faggioli [this message]
2012-06-06 10:35 ` [PATCH] xl: check for meaningful combination of sedf config file parameters Ian Campbell
2012-06-06 11:05 ` Dario Faggioli
2012-06-06 11:07 ` Ian Campbell
2012-06-06 10:41 ` Ian Jackson
2012-06-06 10:48 ` Dario Faggioli
2012-06-06 10:57 ` Ian Jackson
2012-06-06 10:49 ` Ian Campbell
2012-06-06 14:23 ` Dario Faggioli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3eadab19abd49fbc6f56.1338818483@Solace \
--to=raistlin@linux.it \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=juergen.gross@ts.fujitsu.com \
--cc=xen-devel@lists.xen.orgxen-devel \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).