From: Fiona Ebner <f.ebner@proxmox.com>
To: Elias Huhsovitz <e.huhsovitz@proxmox.com>,
Thomas Ellmenreich <t.ellmenreich@proxmox.com>,
pve-devel@lists.proxmox.com
Subject: Re: [PATCH qemu-server 3/3] removed some unnecessary undef checks.
Date: Wed, 5 Aug 2026 11:55:10 +0200 [thread overview]
Message-ID: <b38d8613-56e8-4227-9966-5dece827c935@proxmox.com> (raw)
In-Reply-To: <DKGV6RJWLF4Z.10DCXKKFDXC0E@proxmox.com>
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 <t.ellmenreich@proxmox.com>
>> ---
>> 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.
next prev parent reply other threads:[~2026-08-05 9:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 12:12 [PATCH qemu-server 0/3] refactor of volume_id classification Thomas Ellmenreich
2026-08-03 12:12 ` [PATCH qemu-server 1/3] moved verify_volume_id_or_* format registrations Thomas Ellmenreich
2026-08-04 14:09 ` Elias Huhsovitz
2026-08-03 12:12 ` [PATCH qemu-server 2/3] add new classify_drive_file utility Thomas Ellmenreich
2026-08-04 14:23 ` Elias Huhsovitz
2026-08-03 12:12 ` [PATCH qemu-server 3/3] removed some unnecessary undef checks Thomas Ellmenreich
2026-08-05 8:24 ` Elias Huhsovitz
2026-08-05 9:55 ` Fiona Ebner [this message]
2026-08-05 8:22 ` superseded: [PATCH qemu-server 0/3] refactor of volume_id classification Thomas Ellmenreich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b38d8613-56e8-4227-9966-5dece827c935@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=e.huhsovitz@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=t.ellmenreich@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox