lvm plugin: implement get_formats() method
As the alloc_lvm_image() helper asserts, qcow2 cannot be used as a format without the 'snapshot-as-volume-chain' configuration option. Therefore it is necessary to implement get_formats() and distinguish based on the storage configuration. In case the 'snapshot-as-volume-chain' option is set, qcow2 is even preferred and thus declared the default format. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
committed by
Wolfgang Bumiller
parent
e9e24973fd
commit
dd2efb7846
@ -405,6 +405,16 @@ sub options {
|
||||
|
||||
# Storage implementation
|
||||
|
||||
sub get_formats {
|
||||
my ($class, $scfg, $storeid) = @_;
|
||||
|
||||
if ($scfg->{'snapshot-as-volume-chain'}) {
|
||||
return { default => 'qcow2', valid => { 'qcow2' => 1, 'raw' => 1, } };
|
||||
}
|
||||
|
||||
return { default => 'raw', valid => { 'raw' => 1 } };
|
||||
}
|
||||
|
||||
sub on_add_hook {
|
||||
my ($class, $storeid, $scfg, %param) = @_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user