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 A63F51FF0B3 for ; Wed, 11 Nov 2026 17:20:52 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id A02C721649; Wed, 11 Nov 2026 17:20:49 +0100 (CET) Message-ID: Date: Wed, 11 Nov 2026 17:20:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: David Riley Subject: Re: [PATCH pve-guest-common v2 1/8] AbstractConfig: fix pending delete for options with value 0 To: Jakob Klocker , pve-devel@lists.proxmox.com References: <20261022125111.236538-1-j.klocker@proxmox.com> <20261022125111.236538-2-j.klocker@proxmox.com> Content-Language: en-US In-Reply-To: <20261022125111.236538-2-j.klocker@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794414041179 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.380 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: UG3BZ5BEQ5WA5RFMLUHAU3HRVOH7JXMJ X-Message-ID-Hash: UG3BZ5BEQ5WA5RFMLUHAU3HRVOH7JXMJ X-MailFrom: d.riley@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: Consider this: Reviewed-by: David Riley On 10/22/26 2:51 PM, Jakob Klocker wrote: > 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}; > } > } >