From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id C17461FF09B for ; Mon, 28 Sep 2026 09:16:05 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2BA3C2180E; Mon, 28 Sep 2026 09:15:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dualfroz.com; s=dkim; t=1790314337; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding:in-reply-to:references; bh=hfXwFyEwYxYIPxggge1hKOwMm+wZJfATrsm2lMfmZEo=; b=YPtOrtys7Xr9wn4XdikFWwU/3zCdPy05nV1KDjbBHwmidMjn9+EvyY8aqifvRAPZTP7ZfJ pIvxfGhSGeQemO3+Ds7Yfkc6/izl9ZUweZAoj+3fcyK9d+Kli/yW4kJ2MukdfxBr44/drh A6/dnDBoWdtxUWARTeVHWSay7Nt+bCfg/7m2WtFpO0Tn77bUqiYkXQIZEvYweq09yad8x3 sLU1Ku8i69Gx9XbU8uNrsmAkOaoHLSLkslgyBnbk4Ii1soSbNXRd89tRP/GhghyepFvX2V 84Y7RGEHOPKHueQM4mO5DoK83zQnhXsqDWaj+D0QL8c1qMP+PXBcbJDjIPIEuw== From: Michal Fox To: pve-devel@lists.proxmox.com Subject: [PATCH manager 2/2] fix #7224: ui: utils: show memory usage above 100% correctly Date: Fri, 25 Sep 2026 05:32:14 +0000 Message-ID: <20260925053214.7-3-me@dualfroz.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260925053214.7-1-me@dualfroz.com> References: <20260925053214.7-1-me@dualfroz.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.469 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record X-MailFrom: me@dualfroz.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: 652ZYPLYA6NUZ3OVJ6EXOXO7W2BJDMD2 X-Message-ID-Hash: 652ZYPLYA6NUZ3OVJ6EXOXO7W2BJDMD2 X-Mailman-Approved-At: Mon, 28 Sep 2026 09:14:43 +0200 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: render_mem_usage_percent() treated any value above 1 as a byte count and recalculated the percentage from 'mem' and 'maxmem'. But the memory usage ratio of a guest can legitimately exceed 1, for example when the reported usage is the host-side memory of the QEMU process, which includes its own overhead. In the reported case, 'mem' was 2222472192 with a 'maxmem' of 2147483648, so the ratio of about 1.035 got taken as bytes and the search and resource grids showed 0.0 % instead of 103.5 %. All users of the renderer now pass the usage as a ratio, so drop the bytes fallback and always render the value as percentage. Signed-off-by: Michal Fox --- www/manager6/Utils.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index 8b99371d..91dfd6ee 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -1207,16 +1207,6 @@ Ext.define('PVE.Utils', { if (!Ext.isNumeric(value) || value === -1) { return ''; } - if (value > 1) { - // we got no percentage but bytes - let mem = value; - let maxmem = record.data.maxmem; - if (!record.data.uptime || maxmem === 0 || !Ext.isNumeric(mem)) { - return ''; - } - - return ((mem * 100) / maxmem).toFixed(1) + ' %'; - } return (value * 100).toFixed(1) + ' %'; }, -- 2.43.0