introduce resolve_format_hint() helper
Callers interested in the list of valid formats from storage_default_format() actually want this functionality. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
committed by
Wolfgang Bumiller
parent
ad20e4faef
commit
c86d8f6d80
@ -1681,6 +1681,17 @@ sub storage_default_format {
|
|||||||
wantarray ? ($formats->{default}, [sort keys $formats->{valid}->%*]) : $formats->{default};
|
wantarray ? ($formats->{default}, [sort keys $formats->{valid}->%*]) : $formats->{default};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub resolve_format_hint {
|
||||||
|
my ($cfg, $storeid, $format_hint) = @_;
|
||||||
|
|
||||||
|
my $scfg = storage_config($cfg, $storeid);
|
||||||
|
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
|
||||||
|
|
||||||
|
my $formats = $plugin->get_formats($scfg, $storeid);
|
||||||
|
return $format_hint if $format_hint && $formats->{valid}->{$format_hint};
|
||||||
|
return $formats->{default};
|
||||||
|
}
|
||||||
|
|
||||||
sub vgroup_is_used {
|
sub vgroup_is_used {
|
||||||
my ($cfg, $vgname) = @_;
|
my ($cfg, $vgname) = @_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user