[pve-devel] [PATCH 1/5] add qemu_img_convert

Alexandre DERUMIER aderumier at odiso.com
Tue Apr 23 07:19:07 CEST 2013


>>Why is it necessary to specify source and destination format? 

It's more by security,

from doc:

"fmt is the disk image format. It is guessed automatically in most cases."

I don't like too much "in most cases" ;)

I don't have read code, don't known how format is detected. 
But I can do tests on my side if you want with differents storage to see if it's works fine without format option.

(I think I was having problem with rbd some month ago (need to use rbd format), but now it's works fine with raw format)


----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre Derumier" <aderumier at odiso.com>, pve-devel at pve.proxmox.com 
Envoyé: Mardi 23 Avril 2013 06:19:51 
Objet: RE: [pve-devel] [PATCH 1/5] add qemu_img_convert 

> + my $src_format = qemu_img_format($src_scfg, $src_volname); 
> + my $dst_format = qemu_img_format($dst_scfg, $dst_volname); 
> + 
> + my $src_path = PVE::Storage::path($storecfg, $src_volid, $snapname); 
> + my $dst_path = PVE::Storage::path($storecfg, $dst_volid); 
> + 
> + my $cmd = []; 
> + push @$cmd, '/usr/bin/qemu-img', 'convert', '-t', 'writeback', '-p', '-C'; 
> + push @$cmd, '-s', $snapname if($snapname && $src_format eq 
> "qcow2"); 
> + push @$cmd, '-f', $src_format, '-O', $dst_format, $src_path, 
> +$dst_path; 

Why is it necessary to specify source and destination format? 


More information about the pve-devel mailing list