[pve-devel] [RFC pve-container 1/2] add support to add mountpoints with pct set

Dietmar Maurer dietmar at proxmox.com
Thu Sep 3 11:14:29 CEST 2015


I wonder if mount_all() is the correct place to run mkfs? Would it make
sense to do that in create_disks instead?

>  sub mount_all {
> -    my ($vmid, $storage_cfg, $conf, $format_raw_images) = @_;
> +    my ($vmid, $storage_cfg, $conf, $format_raw_images, $mkdirs) = @_;
>  
>      my $rootdir = "/var/lib/lxc/$vmid/rootfs";
>  
> @@ -1973,10 +1992,13 @@ sub mount_all {
>  	    die "unable to mount base volume - internal error" if $isBase;
>  
>  	    if ($format_raw_images && $format eq 'raw') {
> -		my $cmd = ['mkfs.ext4', '-O', 'mmp', $image_path];
> -		PVE::Tools::run_command($cmd);
> +		if (ref($format_raw_images) ne 'ARRAY' || grep {$_ eq $ms}
> @$format_raw_images) {
> +		    my $cmd = ['mkfs.ext4', '-O', 'mmp', $image_path];
> +		    PVE::Tools::run_command($cmd);
> +		}
>  	    }
>  
> +	    File::Path::make_path "$rootdir/$mount" if $mkdirs;
>  	    mountpoint_mount($mountpoint, $rootdir, $storage_cfg, $loopdevs);
>          });
>      };
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




More information about the pve-devel mailing list