The size is required to be a multiple of volblocksize. Make sure
that the requirement is always met, so ZFS won't complain when we do
things like 'qm resize 102 scsi1 +0.01G'.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
my $attr = $format eq 'subvol' ? 'refquota' : 'volsize';
+ # align size to 1M so we always have a valid multiple of the volume block size
+ if ($format eq 'raw') {
+ my $padding = (1024 - $new_size % 1024) % 1024;
+ $new_size = $new_size + $padding;
+ }
+
$class->zfs_request($scfg, undef, 'set', "$attr=${new_size}k", "$scfg->{pool}/$vname");
return $new_size;