From: Juergen Gross Date: Thu, 28 Sep 2017 09:08:22 +0000 (+0200) Subject: xl: add global grant limit config items X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1321 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e53d5a48ef08ae7003c448dfb71c288e6dc79398;p=xen.git xl: add global grant limit config items Add xl.conf config items for default values of grant limits: max_grant_frames will set the default for the maximum number of grant frames for a domain which will take effect if the domain's config file doesn't specify a value. If max_grant_frames isn't set in xl.conf it will default to 32 for hosts with all memory below 16TB and to 64 for hosts with memory above 16TB. max_maptrack_frames will set the default for the maximum number of maptrack frames for a domain. If max_maptrack_frames isn't set in xl.conf it will default to 0, as normally only backend domains need maptrack frames. Signed-off-by: Juergen Gross Acked-by: Ian Jackson --- diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5 index 88ab506609..fe2cf27ea4 100644 --- a/docs/man/xl.conf.pod.5 +++ b/docs/man/xl.conf.pod.5 @@ -77,6 +77,18 @@ operations (primarily domain creation). Default: C +=item B + +Sets the default value for the C domain config value. + +Default: C<32> on hosts up to 16TB of memory, C<64> on hosts larger than 16TB + +=item B + +Sets the default value for the C domain config value. + +Default: C<0> + =item B Configures the default hotplug script used by virtual network devices. diff --git a/tools/xl/xl.c b/tools/xl/xl.c index 02179a6229..c1bbb4b939 100644 --- a/tools/xl/xl.c +++ b/tools/xl/xl.c @@ -45,6 +45,8 @@ char *default_colo_proxy_script = NULL; enum output_format default_output_format = OUTPUT_FORMAT_JSON; int claim_mode = 1; bool progress_use_cr = 0; +int max_grant_frames = -1; +int max_maptrack_frames = 0; xentoollog_level minmsglevel = minmsglevel_default; @@ -88,6 +90,7 @@ static void parse_global_config(const char *configfile, XLU_Config *config; int e; const char *buf; + libxl_physinfo physinfo; config = xlu_cfg_init(stderr, configfile); if (!config) { @@ -188,6 +191,18 @@ static void parse_global_config(const char *configfile, xlu_cfg_replace_string (config, "colo.default.proxyscript", &default_colo_proxy_script, 0); + if (!xlu_cfg_get_long (config, "max_grant_frames", &l, 0)) + max_grant_frames = l; + else { + libxl_physinfo_init(&physinfo); + max_grant_frames = (libxl_get_physinfo(ctx, &physinfo) != 0 || + !(physinfo.max_possible_mfn >> 32)) + ? 32 : 64; + libxl_physinfo_dispose(&physinfo); + } + if (!xlu_cfg_get_long (config, "max_maptrack_frames", &l, 0)) + max_maptrack_frames = l; + xlu_cfg_destroy(config); } diff --git a/tools/xl/xl.h b/tools/xl/xl.h index 31d660b89a..6b60d1db50 100644 --- a/tools/xl/xl.h +++ b/tools/xl/xl.h @@ -275,6 +275,8 @@ extern char *default_vifbackend; extern char *default_remus_netbufscript; extern char *default_colo_proxy_script; extern char *blkdev_start; +extern int max_grant_frames; +extern int max_maptrack_frames; enum output_format { OUTPUT_FORMAT_JSON,