[pve-devel] [PATCH container 2/2] enable btrfs support via subvolumes

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Jun 10 14:35:43 CEST 2021


On June 9, 2021 3:18 pm, Wolfgang Bumiller wrote:
> Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
> ---
>  src/PVE/LXC.pm         | 4 +++-
>  src/PVE/LXC/Migrate.pm | 7 ++++---
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> index bb1cbdb..9407d24 100644
> --- a/src/PVE/LXC.pm
> +++ b/src/PVE/LXC.pm
> @@ -1871,7 +1871,9 @@ sub alloc_disk {
>  
>      eval {
>  	my $do_format = 0;
> -	if ($scfg->{type} eq 'dir' || $scfg->{type} eq 'nfs' || $scfg->{type} eq 'cifs' ) {
> +	if ($scfg->{type} eq 'dir' || $scfg->{type} eq 'nfs' || $scfg->{type} eq 'cifs'
> +	    || $scfg->{type} eq 'btrfs'
> +	) {
>  	    if ($size_kb > 0) {
>  		$volid = PVE::Storage::vdisk_alloc($storecfg, $storage, $vmid, 'raw',
>  						   undef, $size_kb);
> diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
> index 4370a3d..15c6027 100644
> --- a/src/PVE/LXC/Migrate.pm
> +++ b/src/PVE/LXC/Migrate.pm
> @@ -154,7 +154,7 @@ sub phase1 {
>  	if (defined($snapname)) {
>  	    # we cannot migrate shapshots on local storage
>  	    # exceptions: 'zfspool'

comment needs update ;)

> -	    if (($scfg->{type} eq 'zfspool')) {
> +	    if ($scfg->{type} eq 'zfspool' || $scfg->{type} eq 'btrfs') {
>  		return;
>  	    }
>  	    die "non-migratable snapshot exists\n";
> @@ -218,8 +218,9 @@ sub phase1 {
>  	    my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
>  	    my $scfg =  PVE::Storage::storage_config($self->{storecfg}, $sid);
>  
> -	    my $migratable = ($scfg->{type} eq 'dir') || ($scfg->{type} eq 'zfspool') ||
> -		($scfg->{type} eq 'lvmthin') || ($scfg->{type} eq 'lvm');
> +	    my $migratable = ($scfg->{type} eq 'dir') || ($scfg->{type} eq 'zfspool')
> +		|| ($scfg->{type} eq 'lvmthin') || ($scfg->{type} eq 'lvm')
> +		|| ($scfg->{type} eq 'btrfs');

same as for qemu-server, IMHO we should think about dropping this (or 
moving it to storage plugins as a flag).

>  
>  	    die "storage type '$scfg->{type}' not supported\n"
>  		if !$migratable;
> -- 
> 2.30.2
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 





More information about the pve-devel mailing list