tools/xl: add support for xenstore quota setting via domain config

Add a new "xenstore_quota" domain config parameter for setting the
Xenstore quota of a new domain via a list of <quota>=<val> items.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
This commit is contained in:
Juergen Gross authored and Anthony PERARD committed 2026-03-27 12:06:37 +01:00
1 parent ad860c6454
commit ea3099e191
2 files changed
+31 -1

No files matched your search

+13
View File
@@ -748,6 +748,19 @@ via the B<xl info -x> command in dom0.
The default value is B<0xffffffff>, meaning that all possible Xenstore
features are visible by the guest.
=item B<xenstore_quota=[ QUOTA_SPEC, QUOTA_SPEC, ...]>
Specifies Xenstore quota values of the domain, overriding the default
values of Xenstore.
Each B<QUOTA_SPEC> is a B<quota-name>=B<value> specification. The supported
B<quota-name> identifiers can be obtained by the B<xl xenstore-quota-get -g>
command. B<value> is a non-negative integer.
As per-domain Xenstore quota are an optional Xenstore feature, the
B<xenstore_quota> config parameter may not be supported by all Xenstore
implementations.
=back
=head2 Devices
+18 -1
View File
@@ -1354,7 +1354,7 @@ void parse_config_data(const char *config_source,
XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids, *vtpms,
*usbctrls, *usbdevs, *p9devs, *vdispls, *pvcallsifs_devs;
XLU_ConfigList *channels, *ioports, *irqs, *iomem, *viridian, *dtdevs,
*mca_caps, *smbios, *llc_colors;
*mca_caps, *smbios, *llc_colors, *xs_quota;
int num_ioports, num_irqs, num_iomem, num_cpus, num_viridian, num_mca_caps;
int num_smbios;
int pci_power_mgmt = 0;
@@ -1363,6 +1363,7 @@ void parse_config_data(const char *config_source,
int pci_seize = 0;
int i, e;
int num_llc_colors;
int num_xs_quota;
char *kernel_basename;
libxl_domain_create_info *c_info = &d_config->c_info;
@@ -1470,6 +1471,22 @@ void parse_config_data(const char *config_source,
if (!xlu_cfg_get_long (config, "xenstore_feature_mask", &l, 0))
b_info->xenstore_feature_mask = l;
if (!xlu_cfg_get_list(config, "xenstore_quota", &xs_quota, &num_xs_quota, 0)) {
b_info->xenstore_quota.num_quota = num_xs_quota;
b_info->xenstore_quota.quota = xcalloc(num_xs_quota, sizeof(* b_info->xenstore_quota.quota));
for (i = 0; i < num_xs_quota; i++) {
buf = xlu_cfg_get_listitem(xs_quota, i);
if (!buf) {
fprintf(stderr,
"xl: Can't get element %d in Xenstore quota list\n", i);
exit(1);
}
if (parse_xsquota_item(buf, b_info->xenstore_quota.quota + i))
exit(1);
}
}
libxl_domain_build_info_init_type(b_info, c_info->type);
if (b_info->type == LIBXL_DOMAIN_TYPE_PVH) {
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.