5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-10 01:18:01 +03:00

parse_drive : return correct format

Currently format is always empty, we need to parse file extension

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2013-04-30 06:17:50 +02:00 committed by Dietmar Maurer
parent 3732918544
commit bdf3f36209

View File

@ -900,6 +900,10 @@ sub parse_drive {
return undef if !$res->{file};
if($res->{file} =~ m/\.(raw|cow|qcow|qcow2|vmdk|cloop)$/){
$res->{format} = $1;
}
return undef if $res->{cache} &&
$res->{cache} !~ m/^(off|none|writethrough|writeback|unsafe|directsync)$/;
return undef if $res->{snapshot} && $res->{snapshot} !~ m/^(on|off)$/;