api: volume info: do not fail for zero-sized subvolumes
The special case of size being zero is supported if the volume is of format 'subvol' is a special use case supported in Proxmox VE. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Link: https://lore.proxmox.com/20250303092445.13873-5-f.ebner@proxmox.com
This commit is contained in:
committed by
Thomas Lamprecht
parent
d97d7ff676
commit
0426aa3165
@ -322,7 +322,9 @@ __PACKAGE__->register_method ({
|
|||||||
|
|
||||||
my $path = PVE::Storage::path($cfg, $volid);
|
my $path = PVE::Storage::path($cfg, $volid);
|
||||||
my ($size, $format, $used, $parent) = PVE::Storage::volume_size_info($cfg, $volid);
|
my ($size, $format, $used, $parent) = PVE::Storage::volume_size_info($cfg, $volid);
|
||||||
die "volume_size_info on '$volid' failed\n" if !($format && $size);
|
die "volume_size_info on '$volid' failed - no format\n" if !$format;
|
||||||
|
die "volume_size_info on '$volid' failed - no size\n" if !defined($size);
|
||||||
|
die "volume '$volid' has size zero\n" if !$size && $format ne 'subvol';
|
||||||
|
|
||||||
my $entry = {
|
my $entry = {
|
||||||
path => $path,
|
path => $path,
|
||||||
|
|||||||
Reference in New Issue
Block a user