[Libguestfs] [PATCH] virt-v2v: Create a libvirt-friendly volume name

yupzhang yupzhang at redhat.com
Tue Jul 17 02:31:22 UTC 2012


Hi ajia,

I think the volume name need not to be updated,please refer to bug 
https://bugzilla.redhat.com/show_bug.cgi?id=784495.

Thanks
Yuping


On 07/16/2012 06:00 PM, Alex Jia wrote:
> 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 at 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?
>
> _______________________________________________
> Libguestfs mailing list
> Libguestfs at redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs




More information about the Libguestfs mailing list