xl.conf: introduce 'domid_policy'

This patch adds a new global 'domid_policy' configuration option to decide
how domain id values are allocated for new domains. It may be set to one of
two values:

"xen", the default value, will cause an invalid domid value to be passed
to do_domain_create() preserving the existing behaviour of having Xen
choose the domid value during domain_create().

"random" will cause the special RANDOM_DOMID value to be passed to
do_domain_create() such that libxl__domain_make() will select a random
domid value.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Paul Durrant committed 2020-02-24 17:17:35 +00:00
1 parent 4a3a25678d
commit 64fe38f246
5 files changed
+27

No files matched your search

+10
View File
@@ -45,6 +45,16 @@ The semantics of each C<KEY> defines which form of C<VALUE> is required.
=over 4
=item B<domid_policy="xen"|"random">
Determines how domain-id is set when creating a new domain.
If set to "xen" then the hypervisor will allocate new domain-id values on a sequential basis.
If set to "random" then a random domain-id value will be chosen.
Default: "xen"
=item B<autoballoon="off"|"on"|"auto">
If set to "on" then C<xl> will automatically reduce the amount of
+4
View File
@@ -1,5 +1,9 @@
## Global XL config file ##
# Set domain-id policy. "xen" means that the hypervisor will choose the
# id of a new domain. "random" means that a random value will be chosen.
#domid_policy="xen"
# Control whether dom0 is ballooned down when xen doesn't have enough
# free memory to create a domain. "auto" means only balloon if dom0
# starts with all the host's memory.
+10
View File
@@ -54,6 +54,7 @@ int claim_mode = 1;
bool progress_use_cr = 0;
int max_grant_frames = -1;
int max_maptrack_frames = -1;
libxl_domid domid_policy = INVALID_DOMID;
xentoollog_level minmsglevel = minmsglevel_default;
@@ -228,6 +229,15 @@ static void parse_global_config(const char *configfile,
else
libxl_bitmap_set_any(&global_pv_affinity_mask);
if (!xlu_cfg_get_string (config, "domid_policy", &buf, 0)) {
if (!strcmp(buf, "xen"))
domid_policy = INVALID_DOMID;
else if (!strcmp(buf, "random"))
domid_policy = RANDOM_DOMID;
else
fprintf(stderr, "invalid domid_policy option");
}
xlu_cfg_destroy(config);
}
+1
View File
@@ -283,6 +283,7 @@ extern int max_maptrack_frames;
extern libxl_bitmap global_vm_affinity_mask;
extern libxl_bitmap global_hvm_affinity_mask;
extern libxl_bitmap global_pv_affinity_mask;
extern libxl_domid domid_policy;
enum output_format {
OUTPUT_FORMAT_JSON,
+2
View File
@@ -899,6 +899,8 @@ start:
autoconnect_console_how = 0;
}
d_config.c_info.domid = domid_policy;
if ( restoring ) {
libxl_domain_restore_params params;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.