mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-07-20 19:23:54 +00:00
qemu_img_format: use 'raw' for lvm
With host_device we get the following error: qemu-img: error while writing sector 0: Bad file descriptor
This commit is contained in:
parent
f6ab3bdbf9
commit
ccb5c001d6
@ -4558,20 +4558,17 @@ sub qemu_img_convert {
|
|||||||
sub qemu_img_format {
|
sub qemu_img_format {
|
||||||
my ($scfg, $volname) = @_;
|
my ($scfg, $volname) = @_;
|
||||||
|
|
||||||
if ($scfg->{path} && $volname =~ m/\.(raw|qcow2|qed|vmdk)$/){
|
if ($scfg->{path} && $volname =~ m/\.(raw|qcow2|qed|vmdk)$/) {
|
||||||
return $1;
|
return $1;
|
||||||
}
|
} elsif ($scfg->{type} eq 'nexenta' || $scfg->{type} eq 'iscsidirect') {
|
||||||
elsif ($scfg->{type} eq 'nexenta' || $scfg->{type} eq 'iscsidirect'){
|
|
||||||
return "iscsi";
|
return "iscsi";
|
||||||
}
|
} elsif ($scfg->{type} eq 'iscsi') {
|
||||||
elsif ($scfg->{type} eq 'lvm' || $scfg->{type} eq 'iscsi'){
|
|
||||||
return "host_device";
|
return "host_device";
|
||||||
}
|
} elsif ($scfg->{type} eq 'lvm') {
|
||||||
elsif ($scfg->{type} eq 'rbd'){
|
|
||||||
return "raw";
|
return "raw";
|
||||||
}
|
} elsif ($scfg->{type} eq 'rbd') {
|
||||||
#sheepdog other qemu block driver
|
return "raw";
|
||||||
else{
|
} else { # sheepdog or other qemu block driver
|
||||||
return $scfg->{type};
|
return $scfg->{type};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user