From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 814171FF0C2 for ; Thu, 22 Oct 2026 15:15:20 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id A045C21784; Thu, 22 Oct 2026 15:15:18 +0200 (CEST) Content-Type: text/plain; charset=UTF-8 Date: Thu, 22 Oct 2026 15:15:14 +0200 Message-Id: Subject: Re: [PATCH pve-container 1/2] api: refuse moving volumes if container is protected From: =?utf-8?q?Michael_K=C3=B6ppl?= To: "Jakob Klocker" , Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 X-Mailer: aerc 0.22.0 References: <20260921153545.406664-1-j.klocker@proxmox.com> <20260921153545.406664-2-j.klocker@proxmox.com> In-Reply-To: <20260921153545.406664-2-j.klocker@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792674914963 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.230 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: USBYNNJ4JZM5FYKSGKDKZATAL2LRDCXY X-Message-ID-Hash: USBYNNJ4JZM5FYKSGKDKZATAL2LRDCXY X-MailFrom: m.koeppl@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon Sep 21, 2026 at 5:35 PM CEST, Jakob Klocker wrote: > According to the documentation, a protected container will prevent > volume remove/update operations. > Refuse moving a volume if either the target or the source container is > protected. > > Signed-off-by: Jakob Klocker > --- > src/PVE/API2/LXC.pm | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm > index 88067dd..677eff3 100644 > --- a/src/PVE/API2/LXC.pm > +++ b/src/PVE/API2/LXC.pm > @@ -2601,6 +2601,11 @@ __PACKAGE__->register_method({ > die "cannot move volumes of a running container\n" > if PVE::LXC::check_running($vmid); > > + PVE::LXC::Config->check_protection( > + $conf, > + "cannot move volumes of a protected container\n"= , > + ); > + > if ($mpkey =3D~ m/^unused\d+$/) { > die > "cannot move volume '$mpkey', only configure= d volumes can be moved to " > @@ -2748,6 +2753,15 @@ __PACKAGE__->register_method({ > PVE::LXC::Config->check_lock($target_conf); > } > > + PVE::LXC::Config->check_protection( > + $source_conf, > + "cannot move volumes of a protected container\n", > + ); > + PVE::LXC::Config->check_protection( > + $target_conf, > + "cannot move volumes to a protected container\n", > + ); Doesn't this add a second check that was already added with c05243e4? If the target CT is protected, the second check can never be reached. > + > die "Can't move volumes from or to template CT\n" > if ($source_conf->{template} || $target_conf->{template}= ); >