mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-07-18 04:22:33 +00:00
resolve destination disk format helper: fix indentation
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
bedba57d2b
commit
7dc33415e1
@ -8606,23 +8606,24 @@ sub scsihw_infos {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub resolve_dst_disk_format {
|
sub resolve_dst_disk_format {
|
||||||
my ($storecfg, $storeid, $src_volname, $format) = @_;
|
my ($storecfg, $storeid, $src_volname, $format) = @_;
|
||||||
my ($defFormat, $validFormats) = PVE::Storage::storage_default_format($storecfg, $storeid);
|
|
||||||
|
|
||||||
if (!$format) {
|
my ($defFormat, $validFormats) = PVE::Storage::storage_default_format($storecfg, $storeid);
|
||||||
# if no target format is specified, use the source disk format as hint
|
|
||||||
if ($src_volname) {
|
if (!$format) {
|
||||||
my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
|
# if no target format is specified, use the source disk format as hint
|
||||||
$format = qemu_img_format($scfg, $src_volname);
|
if ($src_volname) {
|
||||||
} else {
|
my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
|
||||||
return $defFormat;
|
$format = qemu_img_format($scfg, $src_volname);
|
||||||
}
|
} else {
|
||||||
|
return $defFormat;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# test if requested format is supported - else use default
|
# test if requested format is supported - else use default
|
||||||
my $supported = grep { $_ eq $format } @$validFormats;
|
my $supported = grep { $_ eq $format } @$validFormats;
|
||||||
$format = $defFormat if !$supported;
|
$format = $defFormat if !$supported;
|
||||||
return $format;
|
return $format;
|
||||||
}
|
}
|
||||||
|
|
||||||
# NOTE: if this logic changes, please update docs & possibly gui logic
|
# NOTE: if this logic changes, please update docs & possibly gui logic
|
||||||
|
Loading…
Reference in New Issue
Block a user