From nobody Mon Apr 13 03:42:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=quarantine dis=quarantine) header.from=suse.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1772719107450767.4861789777042; Thu, 5 Mar 2026 05:58:27 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1246751.1545888 (Exim 4.92) (envelope-from ) id 1vy9DL-0005QS-VK; Thu, 05 Mar 2026 13:58:07 +0000 Received: by outflank-mailman (output) from mailman id 1246751.1545888; Thu, 05 Mar 2026 13:58:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vy9DL-0005PX-Pz; Thu, 05 Mar 2026 13:58:07 +0000 Received: by outflank-mailman (input) for mailman id 1246751; Thu, 05 Mar 2026 13:58:06 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vy98a-00008m-2A for xen-devel@lists.xenproject.org; Thu, 05 Mar 2026 13:53:12 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [2a07:de40:b251:101:10:150:64:2]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a554fb30-189a-11f1-9ccf-f158ae23cfc8; Thu, 05 Mar 2026 14:53:10 +0100 (CET) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 37CAA5BD98; Thu, 5 Mar 2026 13:53:10 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1BB9B3EA68; Thu, 5 Mar 2026 13:53:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id qQ2hBcaKqWktTwAAD6G6ig (envelope-from ); Thu, 05 Mar 2026 13:53:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a554fb30-189a-11f1-9ccf-f158ae23cfc8 Authentication-Results: smtp-out2.suse.de; none From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Anthony PERARD Subject: [PATCH 11/11] tools/xl: add support for xenstore quota setting via domain config Date: Thu, 5 Mar 2026 14:52:08 +0100 Message-ID: <20260305135208.2208663-12-jgross@suse.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260305135208.2208663-1-jgross@suse.com> References: <20260305135208.2208663-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 37CAA5BD98 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Spam-Score: -4.00 X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-ZM-MESSAGEID: 1772719108348158500 Content-Type: text/plain; charset="utf-8" Add a new "xenstore-quota" domain config parameter for setting the Xenstore quota of a new domain via a list of =3D items. Signed-off-by: Juergen Gross --- docs/man/xl.cfg.5.pod.in | 13 +++++++++++++ tools/xl/xl_parse.c | 23 ++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in index 27c455210b..3aac0bc4fb 100644 --- a/docs/man/xl.cfg.5.pod.in +++ b/docs/man/xl.cfg.5.pod.in @@ -748,6 +748,19 @@ via the B command in dom0. The default value is B<0xffffffff>, meaning that all possible Xenstore features are visible by the guest. =20 +=3Ditem B + +Specifies Xenstore quota values of the domain, overriding the default +values of Xenstore. + +Each B is a B=3DB specification. The suppor= ted +B identifiers can be obtained by the B +command. B is a non-negative integer. + +As per-domain Xenstore quota are an optional Xenstore feature, the +B config parameter may not be supported by all Xenstore +implementations. + =3Dback =20 =3Dhead2 Devices diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 934ad4eeef..06a5b60736 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -1351,7 +1351,7 @@ void parse_config_data(const char *config_source, XLU_ConfigList *cpus, *vbds, *nics, *pcis, *cvfbs, *cpuids, *vtpms, *usbctrls, *usbdevs, *p9devs, *vdispls, *pvcallsifs_dev= s; 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 =3D 0; @@ -1360,6 +1360,7 @@ void parse_config_data(const char *config_source, int pci_seize =3D 0; int i, e; int num_llc_colors; + int num_xs_quota; char *kernel_basename; =20 libxl_domain_create_info *c_info =3D &d_config->c_info; @@ -1467,6 +1468,26 @@ void parse_config_data(const char *config_source, if (!xlu_cfg_get_long (config, "xenstore_feature_mask", &l, 0)) b_info->xenstore_feature_mask =3D l; =20 + if (!xlu_cfg_get_list(config, "xenstore_quota", &xs_quota, &num_xs_quo= ta, 0)) { + b_info->xenstore_quota.num_quota =3D num_xs_quota; + b_info->xenstore_quota.quota =3D calloc(num_xs_quota, sizeof(* b_i= nfo->xenstore_quota.quota)); + if (b_info->xenstore_quota.quota =3D=3D NULL) { + fprintf(stderr, "unable to allocate memory for xenstore_quota\= n"); + exit(-1); + } + + for (i =3D 0; i < num_xs_quota; i++) { + buf =3D 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); =20 if (b_info->type =3D=3D LIBXL_DOMAIN_TYPE_PVH) { --=20 2.53.0