From nobody Sun May 19 02:06:36 2024 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=1651481288; cv=none; d=zohomail.com; s=zohoarc; b=hSX3SWnm6bGzWcg3d1Erd7jKbSIUPQXyweMArCd08A39zhrQJQfmaJPRWvGQaD8o3DgEkkzW24IzUi8isc9Ub5n8skiYYfkXfLZRzK0SVCuhIiMk4D2M2QKMTIDB/SblI/afzs+BslJvjqp2u9F7BWcznwAnPXN8JKHzjnch8ts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651481288; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=3YGp09FIL19SEfwLZBKJrZGe61G82XI/DK4ZCzyeUww=; b=Np+rjCBERRhTzCBcEs/TTsqOvP1fjWmqGDu4wU061eieNldGYVr70a7ZJo6BT7XSjeY2swWCVmOpusIuEp9e75z9Sc3fLzmNFh0Cu3vNFG29NGgiPXcRLQWuBxOB7P6QMy8zY5La+PmZjxOPn48NVwhqt+fCZh9pqTtYFsWaQYU= 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 165148128856964.95179424087326; Mon, 2 May 2022 01:48:08 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.318724.538610 (Exim 4.92) (envelope-from ) id 1nlRiQ-0008WS-RJ; Mon, 02 May 2022 08:47:34 +0000 Received: by outflank-mailman (output) from mailman id 318724.538610; Mon, 02 May 2022 08:47:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nlRiQ-0008WL-Nl; Mon, 02 May 2022 08:47:34 +0000 Received: by outflank-mailman (input) for mailman id 318724; Mon, 02 May 2022 08:47:33 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nlRiP-0008WF-LS for xen-devel@lists.xenproject.org; Mon, 02 May 2022 08:47:33 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 81483a6e-c9f4-11ec-a405-831a346695d4; Mon, 02 May 2022 10:47:32 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id AE33E210EC; Mon, 2 May 2022 08:47:31 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 89207133E5; Mon, 2 May 2022 08:47:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PO4iIKOab2JXFgAAMHmgww (envelope-from ); Mon, 02 May 2022 08:47:31 +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: 81483a6e-c9f4-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1651481251; 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; bh=3YGp09FIL19SEfwLZBKJrZGe61G82XI/DK4ZCzyeUww=; b=uHWnRqYyDeNiAhGeSvNuQVtBugZZEBF/T3GhiUaydYzG90eZypJtp4QeUXrx3dnsOVXce6 ScpkEKO/0DvyK13BT4zUog+/CXq5CgvfICC5RnnGpTj782kQwRvrh2dPFpC/3GxHRZy3fB tp+lDkHG46df8exc7WKvu8y6jrY9GVM= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , Anthony PERARD Subject: [PATCH v3] tools/libs/light: update xenstore entry when setting max domain memory Date: Mon, 2 May 2022 10:47:29 +0200 Message-Id: <20220502084729.13044-1-jgross@suse.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1651481289261100001 Content-Type: text/plain; charset="utf-8" libxl_domain_setmaxmem() called during "xl mem-max" should update the domain's memory/static-max Xenstore node, as otherwise "xl mem-set" won't be able to set the memory size to the new maximum. Adjust the related comments and documentation accordingly. Signed-off-by: Juergen Gross Reviewed-by: Anthony PERARD --- V2: - adjust comments and docs (Anthony Perard) V3: - really adjust the docs (Anthony Perard) --- docs/man/xl.1.pod.in | 11 +++++------ tools/libs/light/libxl_mem.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/man/xl.1.pod.in b/docs/man/xl.1.pod.in index e2176bd696..101e14241d 100644 --- a/docs/man/xl.1.pod.in +++ b/docs/man/xl.1.pod.in @@ -442,15 +442,14 @@ allocate. The default unit is kiB. Add 't' for TiB, 'g' for GiB, 'm' for MiB, 'k' for kiB, and 'b' for bytes (e.g., `2048m` for 2048 MiB). =20 -NB that users normally shouldn't need this command; B will -set this as appropriate automatically. - I can't be set lower than the current memory target for I. It is allowed to be higher than the configured maximum memory size of the domain (B parameter in the domain's -configuration). Note however that the initial B value is still -used as an upper limit for B. Also note that calling B will reset this value. +configuration). + +Setting the maximum memory size above the configured maximum memory size +will require special guest support (memory hotplug) in order to be usable +by the guest. =20 The domain will not receive any signal regarding the changed memory limit. diff --git a/tools/libs/light/libxl_mem.c b/tools/libs/light/libxl_mem.c index c739d00f39..92ec09f4cf 100644 --- a/tools/libs/light/libxl_mem.c +++ b/tools/libs/light/libxl_mem.c @@ -20,8 +20,7 @@ /* * Set the maximum memory size of the domain in the hypervisor. There is no * change of the current memory size involved. The specified memory size c= an - * even be above the configured maxmem size of the domain, but the related - * Xenstore entry memory/static-max isn't modified! + * even be above the configured maxmem size of the domain. */ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domid, uint64_t max_me= mkb) { @@ -82,6 +81,15 @@ int libxl_domain_setmaxmem(libxl_ctx *ctx, uint32_t domi= d, uint64_t max_memkb) goto out; } =20 + rc =3D libxl__xs_printf(gc, XBT_NULL, + GCSPRINTF("%s/memory/static-max", dompath), + "%"PRIu64, max_memkb); + if (rc !=3D 0) { + LOGED(ERROR, domid, "Couldn't set %s/memory/static-max, rc=3D%d\n", + dompath, rc); + goto out; + } + rc =3D 0; out: libxl_domain_config_dispose(&d_config); --=20 2.34.1