api: storage status: filter out qcow2 format as valid for LVM without external-snapshots

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2025-07-16 22:35:08 +02:00
parent 41c6e4bf7a
commit 2cd4dafb22

View File

@ -220,6 +220,12 @@ __PACKAGE__->register_method({
$data->{used_fraction} = ($data->{used} // 0) / $data->{total};
}
# TODO: add support to the storage plugin system to allow returing different supported
# formats depending on the storage config instead, this is just a stop gap!
if (lc($data->{type}) eq 'lvm') {
$data->{format}[0]->{qcow2} = 0 if !$scfg->{'external-snapshots'};
}
$res->{$storeid} = $data;
}