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 5FD061FF12C for ; Wed, 05 Aug 2026 11:55:15 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 1B45E216AA; Wed, 05 Aug 2026 11:55:15 +0200 (CEST) Message-ID: Date: Wed, 5 Aug 2026 11:55:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH qemu-server 3/3] removed some unnecessary undef checks. To: Elias Huhsovitz , Thomas Ellmenreich , pve-devel@lists.proxmox.com References: <20260803121300.138287-1-t.ellmenreich@proxmox.com> <20260803121300.138287-4-t.ellmenreich@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785923697569 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.145 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) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low 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: CIXVRFNR55AKGZ6EXJEXHBU2XOZ7V5WS X-Message-ID-Hash: CIXVRFNR55AKGZ6EXJEXHBU2XOZ7V5WS X-MailFrom: f.ebner@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: Am 05.08.26 um 10:24 AM schrieb Elias Huhsovitz: > Summary > ------- > * classify_drive_file() and drive_has_absolute_path() are not prepared > to handle undef values, and therefore removing the undef checks causes > a change in behaviour > > * commit message should be imperative, e.g., "remove some unnecessary > undef checks" > > On Mon Aug 3, 2026 at 2:12 PM CEST, Thomas Ellmenreich wrote: >> Signed-off-by: Thomas Ellmenreich >> --- >> src/PVE/QemuServer.pm | 12 ++++-------- >> 1 file changed, 4 insertions(+), 8 deletions(-) >> >> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm >> index 0e998cbe..3141b298 100644 >> --- a/src/PVE/QemuServer.pm >> +++ b/src/PVE/QemuServer.pm >> @@ -1818,11 +1818,10 @@ sub destroy_vm { >> { include_unused => 1 }, >> sub { >> my ($ds, $drive) = @_; >> - return if drive_is_cdrom($drive); >> >> - my $volid = $drive->{file}; >> - return if !$volid || drive_has_absolute_path($drive); > > I think this might result in an edge case where $drive->{file} can be undef, > causing the underlying function classify_drive_file() that drive_has_absolute_path() > calls, to emit a warning. No, because the foreach_volume_full() function parses the drive string and skips without calling the subroutine if parsing fails. If parsing succeeds, $drive->{file} is populated. Of course the rationale for why removing the checks is justified should be stated in the commit message.