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 264A6BD5B for ; Fri, 25 Nov 2022 15:41:12 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 77F061DCC8 for ; Fri, 25 Nov 2022 15:40:40 +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 ; Fri, 25 Nov 2022 15:40:39 +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 9CD8444E2D for ; Fri, 25 Nov 2022 15:40:37 +0100 (CET) From: Stefan Hrdlicka To: pve-devel@lists.proxmox.com Date: Fri, 25 Nov 2022 15:40:06 +0100 Message-Id: <20221125144008.2988072-6-s.hrdlicka@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221125144008.2988072-1-s.hrdlicka@proxmox.com> References: <20221125144008.2988072-1-s.hrdlicka@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [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: Fri, 25 Nov 2022 14:41:12 -0000 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) }; + 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); }; return if !$path || !$owner || ($owner != $vmid); $volids->{$volid} = 1; -- 2.30.2