[pve-devel] [PATCH v2 qemu-server 2/7] restore destroy volumes: remove check for absolute path

Fabian Ebner f.ebner at proxmox.com
Thu Apr 21 13:26:50 CEST 2022


Only a result from vdisk_alloc is assigned as a volid and that's never
an absolute path.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

No changes from v1.

 PVE/QemuServer.pm | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index f221d93c..be0694f9 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6470,11 +6470,7 @@ my $restore_destroy_volumes = sub {
 	my $volid = $devinfo->{$devname}->{volid};
 	next if !$volid;
 	eval {
-	    if ($volid =~ m|^/|) {
-		unlink $volid || die 'unlink failed\n';
-	    } else {
-		PVE::Storage::vdisk_free($storecfg, $volid);
-	    }
+	    PVE::Storage::vdisk_free($storecfg, $volid);
 	    print STDERR "temporary volume '$volid' sucessfuly removed\n";
 	};
 	print STDERR "unable to cleanup '$volid' - $@" if $@;
-- 
2.30.2






More information about the pve-devel mailing list