From nobody Mon Mar 23 21:28:28 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; dkim=pass; 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=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1774019527; cv=none; d=zohomail.com; s=zohoarc; b=TQnDgzsKAuGgp9DwDlQWRuqKm7MObQ5nu0HXKWSK1S9MFy2TEWR2UaaRbUgLTte2YOKnAkYZGWo2Hk8MSki0BcExewSINgshVUe0l5e7oK52aCl5167Ohhew8JfOLvNRVA5tCtQXCYaxJuf5luuF24WZwa1r7p2rVZ2WYqgb4xc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1774019527; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RvZyWf80UhIWQ1Ha92/GkHwBZUAkRxIiyYOr24YFL4c=; b=F6xRHt9AKTs0zULyZMfL9Zy2iy97Ta3cAcLeugHV0JA5Hu5wpDRmS92dfRvVM95NUxiBM0/ptVxFjFXY/hA8NHiXL/9dR/IR8zQvTN83CpIdYoS8xPkzG8jOqWx/knoCFeOBauMucflrXvfXVoLUxnR8M53dBJWwbma7ReicXX8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1774019527883427.9589767096596; Fri, 20 Mar 2026 08:12:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1258221.1552374 (Exim 4.92) (envelope-from ) id 1w3bW0-0001h1-FM; Fri, 20 Mar 2026 15:11:56 +0000 Received: by outflank-mailman (output) from mailman id 1258221.1552374; Fri, 20 Mar 2026 15:11:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w3bW0-0001gu-CH; Fri, 20 Mar 2026 15:11:56 +0000 Received: by outflank-mailman (input) for mailman id 1258221; Fri, 20 Mar 2026 15:11:54 +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 1w3bMv-0001ko-3N for xen-devel@lists.xenproject.org; Fri, 20 Mar 2026 15:02:33 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d1821fae-246d-11f1-9ccf-f158ae23cfc8; Fri, 20 Mar 2026 16:02:31 +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 4F34F5BDF1; Fri, 20 Mar 2026 15:02:27 +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 328F242866; Fri, 20 Mar 2026 15:02:27 +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 e5RHC4NhvWkQXQAAD6G6ig (envelope-from ); Fri, 20 Mar 2026 15:02:27 +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: d1821fae-246d-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1774018947; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RvZyWf80UhIWQ1Ha92/GkHwBZUAkRxIiyYOr24YFL4c=; b=u2wXVdKkXq1jVy9V9f9iklAiWJ5Kt3UogaAKILZjUMZ8+6H6zjmiSsBBPYECJAkcOZpIQx 96RgUK6eWPXG9IzikBjViC+o25mHnBc8u8N3nzfCqtvYVmT1krXOwZTwR+9pfuZVpcdowr ytNq900LHAh/UqcEAkP0twmudkMANe4= Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=u2wXVdKk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1774018947; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RvZyWf80UhIWQ1Ha92/GkHwBZUAkRxIiyYOr24YFL4c=; b=u2wXVdKkXq1jVy9V9f9iklAiWJ5Kt3UogaAKILZjUMZ8+6H6zjmiSsBBPYECJAkcOZpIQx 96RgUK6eWPXG9IzikBjViC+o25mHnBc8u8N3nzfCqtvYVmT1krXOwZTwR+9pfuZVpcdowr ytNq900LHAh/UqcEAkP0twmudkMANe4= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Anthony PERARD Subject: [PATCH v2 12/12] tools/xl: add support for xenstore quota setting via domain config Date: Fri, 20 Mar 2026 16:01:20 +0100 Message-ID: <20260320150120.874878-13-jgross@suse.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260320150120.874878-1-jgross@suse.com> References: <20260320150120.874878-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:dkim,suse.com:email,vates.tech:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; DKIM_TRACE(0.00)[suse.com:+] X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -3.01 X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 4F34F5BDF1 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1774019528767154101 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 Reviewed-by: Anthony PERARD --- V2: - fix typo in commit message (Anthony Perard) - use xcalloc() (Anthony Perard) --- docs/man/xl.cfg.5.pod.in | 13 +++++++++++++ tools/xl/xl_parse.c | 19 ++++++++++++++++++- 2 files changed, 31 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 4b074fdb58..48c72dce9c 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -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_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; @@ -1363,6 +1363,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; @@ -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 =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 xcalloc(num_xs_quota, sizeof(* b_= info->xenstore_quota.quota)); + + 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