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
> [email protected]
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 

_______________________________________________
pve-devel mailing list
[email protected]
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to