[pve-devel] applied: [PATCH storage v2 2/3] make max number of disks a constant

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Sep 11 08:11:14 CEST 2018


On 9/7/18 3:08 PM, Stoiko Ivanov wrote:
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
>  PVE/Storage/Plugin.pm | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
> index 32acf69..7516f4e 100644
> --- a/PVE/Storage/Plugin.pm
> +++ b/PVE/Storage/Plugin.pm
> @@ -31,6 +31,8 @@ our @SHARED_STORAGE = (
>      'zfs',
>      'drbd');
>  
> +our $MAX_VOLUMES_PER_GUEST = 1024;
> +
>  cfs_register_file ('storage.cfg',
>  		   sub { __PACKAGE__->parse_config(@_); },
>  		   sub { __PACKAGE__->write_config(@_); });
> @@ -557,7 +559,7 @@ sub get_next_vm_diskname {
>      my $prefix = ($fmt eq 'subvol') ? 'subvol' : 'vm';
>      my $suffix = $add_fmt_suffix ? ".$fmt" : '';
>  
> -    for (my $i = 1; $i < 100; $i++) {
> +    for (my $i = 1; $i < $MAX_VOLUMES_PER_GUEST; $i++) {
>  	if (!$disk_ids->{$i}) {
>  	    return "$prefix-$vmid-disk-$i$suffix";
>  	}
> 

applied, with a followup starting the disk numbers from 0, and adapting the
regression tests.



More information about the pve-devel mailing list