[pve-devel] [PATCH qemu-server v4 3/5] Initial support for importing OVF virtual machines

Emmanuel Kasper e.kasper at proxmox.com
Thu May 4 11:57:46 CEST 2017


>> +	# tricky xpath
>> +	# @ means we filter the result query based on a the value of an item attribute ( @ = attribute)
>> +	# @ needs to be escaped to prevent Perl double quote interpolation
>> +	my $xpath_find_fileref = sprintf("/ovf:Envelope/ovf:DiskSection/\
>> +ovf:Disk[\@ovf:diskId='%s']/\@ovf:fileRef", $disk_id);
> 
> Is there a particular reason for using sprintf instead of an
> interpolated string (same for the rest below)? 

Readability ? The xpath query is already quite a character soup, and
I did not want to the next person to read this to miss the variable
interpolation.

I'll send soonish a V5 with all the other suggestions.

Emmanuel






More information about the pve-devel mailing list