From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A62FF71056 for ; Mon, 17 May 2021 15:41:43 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 85AC22C7D8 for ; Mon, 17 May 2021 15:41:13 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 754D92C7CA for ; Mon, 17 May 2021 15:41:12 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 168A2465AA for ; Mon, 17 May 2021 15:41:12 +0200 (CEST) Message-ID: <310011e6-083d-e241-80cc-17024a77db31@proxmox.com> Date: Mon, 17 May 2021 15:41:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Thunderbird/89.0 Content-Language: en-US To: Proxmox VE development discussion , Lorenz Stechauner References: <20210517090324.63391-1-l.stechauner@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20210517090324.63391-1-l.stechauner@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.006 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH v2 container] fix #3421: allow custom storage plugins to support rootfs X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2021 13:41:43 -0000 On 17.05.21 11:03, Lorenz Stechauner wrote: > it is now necessary for storages to support the 'rootdir' content > in order to create/start containers on them. all native storage > plugins already report the rootdir content correctly. > > Signed-off-by: Lorenz Stechauner > --- I'm missing the description of changes from v1 -> v2 here... > src/PVE/LXC.pm | 30 ++++++++++++------------------ > 1 file changed, 12 insertions(+), 18 deletions(-) > > diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm > index 7e6f378..75e1c20 100644 > --- a/src/PVE/LXC.pm > +++ b/src/PVE/LXC.pm > @@ -1682,15 +1682,16 @@ sub __mountpoint_mount { > } > }; > my $use_loopdev = 0; > - if ($scfg->{path}) { > - $mounted_dev = run_with_loopdev($domount, $path, $readonly); > - $use_loopdev = 1; > - } elsif ($scfg->{type} eq 'drbd' || $scfg->{type} eq 'lvm' || > - $scfg->{type} eq 'rbd' || $scfg->{type} eq 'lvmthin') { > - $mounted_dev = $path; > - &$domount($path); > + if ($scfg->{content}->{rootdir}) { > + if ($scfg->{path}) { > + $mounted_dev = run_with_loopdev($domount, $path, $readonly); > + $use_loopdev = 1; > + } else { > + $mounted_dev = $path; > + &$domount($path); > + } > } else { > - die "unsupported storage type '$scfg->{type}'\n"; > + die "storage type '$scfg->{type}' does not support containers\n"; > } > return wantarray ? ($path, $use_loopdev, $mounted_dev) : $path; > } else { > @@ -1871,7 +1872,7 @@ sub alloc_disk { > > eval { > my $do_format = 0; > - if ($scfg->{type} eq 'dir' || $scfg->{type} eq 'nfs' || $scfg->{type} eq 'cifs' ) { > + if ($scfg->{content}->{rootdir} && $scfg->{path}) { > if ($size_kb > 0) { > $volid = PVE::Storage::vdisk_alloc($storecfg, $storage, $vmid, 'raw', > undef, $size_kb); > @@ -1882,21 +1883,14 @@ sub alloc_disk { > $needs_chown = 1; > } > } elsif ($scfg->{type} eq 'zfspool') { > - > $volid = PVE::Storage::vdisk_alloc($storecfg, $storage, $vmid, 'subvol', > undef, $size_kb); > $needs_chown = 1; > - } elsif ($scfg->{type} eq 'drbd' || $scfg->{type} eq 'lvm' || $scfg->{type} eq 'lvmthin') { > - > - $volid = PVE::Storage::vdisk_alloc($storecfg, $storage, $vmid, 'raw', undef, $size_kb); > - $do_format = 1; > - > - } elsif ($scfg->{type} eq 'rbd') { > - > + } elsif ($scfg->{content}->{rootdir}) { > $volid = PVE::Storage::vdisk_alloc($storecfg, $storage, $vmid, 'raw', undef, $size_kb); > $do_format = 1; > } else { > - die "unable to create containers on storage type '$scfg->{type}'\n"; > + die "storage type '$scfg->{type}' does not supoort containers\n"; > } > format_disk($storecfg, $volid, $rootuid, $rootgid) if $do_format; > }; >