On 07/11/2012 06:33 PM, Alex Jia wrote:
The $vmdk value is a directory name in ESX.pm, although the later
codes
replace '/' with '_', the volume name isn't still friendly, for
example,
it looks like this:
# virsh vol-list pool-dir
Name Path
-----------------------------------------
esx4.1-rhel6.2-x86_64_esx4.1-rhel6.2-x86_64
/mnt/esx4.1-rhel6.2-x86_64_esx4.1-rhel6.2-x86_64
With the patch, the volume name is very friendly like guest name:
# virsh vol-list pool-dir
Name Path
-----------------------------------------
esx4.1-rhel6.2-x86_64 /mnt/esx4.1-rhel6.2-x86_64
Signed-off-by: Alex Jia<ajia(a)redhat.com>
---
lib/Sys/VirtConvert/Transfer/ESX.pm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/Sys/VirtConvert/Transfer/ESX.pm b/lib/Sys/VirtConvert/Transfer/ESX.pm
index 23969cd..f29eb31 100644
--- a/lib/Sys/VirtConvert/Transfer/ESX.pm
+++ b/lib/Sys/VirtConvert/Transfer/ESX.pm
@@ -368,8 +368,9 @@ sub new
}
# Create a libvirt-friendly volume name
- $self->{name} = $vmdk;
- $self->{name} =~ s,/,_,g;
+ use File::Basename;
+ my($name, $dir, $suffix) = fileparse($vmdk);
+ $self->{name} = $name;
return $self;
}
Hi Matt, any advise about this?