From nobody Fri May 17 03:39:51 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=1650441911; cv=none; d=zohomail.com; s=zohoarc; b=j4C29vJgVuFXiBy1/0khxvCteGsNjq/oZAsOcyfEcKIZ/P1h2i1fT8aDgrORxczrQ/6mjIYyRH5N34O/ZfaHKohvkCQIpapqrKnr43tIZE8HuMU+UeBpVNCvU4GvnT3plkYy5gXF9NuXLuc7i4vGM2bXrPtyDMFdlkFYZe/vGY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650441911; 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=OEc5VwXg/asXng3njAe1udGsbyNDGB6ncjnpuOLJcyg=; b=jfNFfHincg/9iJLe6raR8yV9BTQegujWEIxwHc6tXoU1WrCosk9sQQNeDKmEp9snkrKqiEjqOUCa4mEPLgaz2ocI3qdrrDGTrxMWPmJIEYN3wIvwxuL/qI3Gm6Eu1IUql/56IRJjScnoPvHcvZcPsYKDSnmy3frGHc5WDnrWVt4= 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 1650441911358860.5854562883048; Wed, 20 Apr 2022 01:05:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.308972.524906 (Exim 4.92) (envelope-from ) id 1nh5KA-0004xC-VX; Wed, 20 Apr 2022 08:04:30 +0000 Received: by outflank-mailman (output) from mailman id 308972.524906; Wed, 20 Apr 2022 08:04:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nh5KA-0004x5-Sb; Wed, 20 Apr 2022 08:04:30 +0000 Received: by outflank-mailman (input) for mailman id 308972; Wed, 20 Apr 2022 08:04:30 +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 1nh5KA-0004wz-Cj for xen-devel@lists.xenproject.org; Wed, 20 Apr 2022 08:04:30 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 80743973-c080-11ec-8fbf-03012f2f19d4; Wed, 20 Apr 2022 10:04:28 +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-out2.suse.de (Postfix) with ESMTPS id C28761F380; Wed, 20 Apr 2022 08:04:28 +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 9E77313A30; Wed, 20 Apr 2022 08:04:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /hRuJYy+X2JSagAAMHmgww (envelope-from ); Wed, 20 Apr 2022 08:04:28 +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: 80743973-c080-11ec-8fbf-03012f2f19d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1650441868; 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=OEc5VwXg/asXng3njAe1udGsbyNDGB6ncjnpuOLJcyg=; b=dhCIQlBq1C4d/blI+i/S/MUFxe24DyFePXLBW/bNoTQOurIzMZr/Uaee2uEtR0ORTiH/t5 iAEPBmeh/mK+mTJn0UuX4GvKt283509HcTNmS2L84Gg9y1vIbiB8zvF5Kiih4PzYYBFqiJ Ivay+zy9A7wqo1jHNmfQ5qcNFrvm70o= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , Anthony PERARD Subject: [PATCH v2] tools/libs/light: update xenstore entry when setting max domain memory Date: Wed, 20 Apr 2022 10:04:26 +0200 Message-Id: <20220420080426.7036-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: 1650441912871100001 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 --- V2: - adjust comments and docs (Anthony Perard) --- tools/libs/light/libxl_mem.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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