From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 7B4A4EF19 for ; Tue, 13 Dec 2022 14:09:09 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 619711FA6E for ; Tue, 13 Dec 2022 14:08:39 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 13 Dec 2022 14:08:38 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 25A1742B59 for ; Tue, 13 Dec 2022 14:08:38 +0100 (CET) Message-ID: Date: Tue, 13 Dec 2022 14:08:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-Language: en-US To: pve-devel@lists.proxmox.com, Stefan Hrdlicka References: <20221125144008.2988072-1-s.hrdlicka@proxmox.com> <20221125144008.2988072-6-s.hrdlicka@proxmox.com> From: Fiona Ebner In-Reply-To: <20221125144008.2988072-6-s.hrdlicka@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemuserver.pm] Subject: Re: [pve-devel] [PATCH V4 qemu-server 5/7] ignore PVE::Storage::path errors when deleting VMs X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2022 13:09:09 -0000 Some rationale in the commit message would be nice, along the lines of "we already ignore storage errors except these, let's finish the job" Am 25.11.22 um 15:40 schrieb Stefan Hrdlicka: > Signed-off-by: Stefan Hrdlicka > --- > PVE/QemuServer.pm | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index 51e9a51..331677f 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -2341,10 +2341,9 @@ sub destroy_vm { > > my $volid = $drive->{file}; > return if !$volid || $volid =~ m|^/|; > - > - die "base volume '$volid' is still in use by linked cloned\n" > - if PVE::Storage::volume_is_base_and_used($storecfg, $volid); > - > + my $result; > + eval { $result = PVE::Storage::volume_is_base_and_used($storecfg, $volid) }; Same style nit as for the container patch: my $result = eval {...}; But here it's fine to not propagate the error, because 1. We already ignore storage errors by default 2. The check is done again inside vdisk_free() It would be nice to add a comment in the code here mentioning point 2. We could also log a warning here, but no big deal. > + die "base volume '$volid' is still in use by linked cloned\n" if $result; > }); > } > > @@ -2357,7 +2356,8 @@ sub destroy_vm { > return if !$volid || $volid =~ m|^/|; > return if $volids->{$volid}; > > - my ($path, $owner) = PVE::Storage::path($storecfg, $volid); > + my ($path, $owner); > + eval { ($path, $owner) = PVE::Storage::path($storecfg, $volid); }; Same style nit my ($path, $owner) = eval {...}; Should log a warning if the eval fails. > return if !$path || !$owner || ($owner != $vmid); > > $volids->{$volid} = 1;