From f104d1dd077ab7abbad0ba7470d64500aef264f3 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Tue, 5 Feb 2013 12:55:28 +0100 Subject: [PATCH] storage : vdisk_free : eval parse_volname If the storage have some customs volumes name, vdisk_free will hang Signed-off-by: Alexandre Derumier --- PVE/Storage.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 50bd0c5..c2f83a0 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -528,11 +528,15 @@ sub vdisk_free { my $vollist = $plugin->list_images($storeid, $scfg); foreach my $info (@$vollist) { my (undef, $tmpvolname) = parse_volume_id($info->{volid}); + my $basename = undef; + my $basevmid = undef; - my (undef, undef, undef, $basename, $basevmid) = - $plugin->parse_volname($tmpvolname); + eval{ + (undef, undef, undef, $basename, $basevmid) = + $plugin->parse_volname($tmpvolname); + }; - if ($basename && $basevmid == $vmid && $basename eq $name) { + if ($basename && $basevmid && $basevmid == $vmid && $basename eq $name) { die "base volume '$volname' is still in use " . "(use by '$tmpvolname')\n"; }