From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 682421FF0C2 for ; Thu, 22 Oct 2026 14:51:40 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2FE6D21812; Thu, 22 Oct 2026 14:51:33 +0200 (CEST) From: Jakob Klocker To: pve-devel@lists.proxmox.com Subject: [PATCH pve-guest-common v2 1/8] AbstractConfig: fix pending delete for options with value 0 Date: Thu, 22 Oct 2026 14:51:04 +0200 Message-ID: <20261022125111.236538-2-j.klocker@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261022125111.236538-1-j.klocker@proxmox.com> References: <20261022125111.236538-1-j.klocker@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792673488952 X-SPAM-LEVEL: Spam detection results: 0 AWL 1.353 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) KAM_NUMSUBJECT 0.5 Subject ends in numbers excluding current years RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: KSL2XLTGO6QVHXXOPNU7YEET5VPNPRTC X-Message-ID-Hash: KSL2XLTGO6QVHXXOPNU7YEET5VPNPRTC X-MailFrom: j.klocker@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When building the merged runtime configuration (`load_current_config`), pending deletions check `if $conf->{$opt}` before clearing keys. Because a value of `0` evaluates to false in Perl, the condition fails and the key is left in the merged view. While the final configuration application on restart still clears the key, this causes UI desynchronization during the pending state (e.g., UI components see the old `0` value and misrender). Using `defined` ensures the merged view correctly reflects pending deletions immediately. Signed-off-by: Jakob Klocker --- src/PVE/AbstractConfig.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/AbstractConfig.pm b/src/PVE/AbstractConfig.pm index 7bcae19..a708ced 100644 --- a/src/PVE/AbstractConfig.pm +++ b/src/PVE/AbstractConfig.pm @@ -242,7 +242,7 @@ sub load_current_config { } my $pending_delete_hash = $class->parse_pending_delete($conf->{pending}->{delete}); foreach my $opt (keys %$pending_delete_hash) { - delete $conf->{$opt} if $conf->{$opt}; + delete $conf->{$opt} if defined $conf->{$opt}; } } -- 2.47.3