mirror of
https://git.proxmox.com/git/qemu-server
synced 2026-01-06 19:36:03 +00:00
add check to resize disk if current size could not be determined
This check ensures that disks aren't unintentionally shrunken, if the size is zero due to an underlying problem.
This commit is contained in:
parent
fda7291362
commit
f8b829aaba
@ -3579,6 +3579,8 @@ __PACKAGE__->register_method({
|
||||
PVE::Storage::activate_volumes($storecfg, [$volid]);
|
||||
my $size = PVE::Storage::volume_size_info($storecfg, $volid, 5);
|
||||
|
||||
die "Size of volume $volid couldn't be determined\n" if (!defined($size));
|
||||
|
||||
die "internal error" if $sizestr !~ m/^(\+)?(\d+(\.\d+)?)([KMGT])?$/;
|
||||
my ($ext, $newsize, $unit) = ($1, $2, $4);
|
||||
if ($unit) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user