public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Jakob Klocker <j.klocker@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 2/2] api: refuse moving disks if source VM is protected
Date: Mon, 21 Sep 2026 17:35:45 +0200	[thread overview]
Message-ID: <20260921153545.406664-3-j.klocker@proxmox.com> (raw)
In-Reply-To: <20260921153545.406664-1-j.klocker@proxmox.com>

Moving a disk removes it from the source VM, which, according to the
documentation, the protection flag prevents.
Refuse the move when the source is protected.

Signed-off-by: Jakob Klocker <j.klocker@proxmox.com>
---
 src/PVE/API2/Qemu.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 922c6599..3cf3517b 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -5024,6 +5024,11 @@ __PACKAGE__->register_method({
             my $target_conf = PVE::QemuConfig->load_config($target_vmid);
             PVE::QemuConfig->check_lock($target_conf);
 
+            PVE::QemuConfig->check_protection(
+                $source_conf,
+                "Can't move disks from protected VMs\n",
+            );
+
             die "Can't move disks from or to template VMs\n"
                 if ($source_conf->{template} || $target_conf->{template});
 
-- 
2.47.3




      parent reply	other threads:[~2026-09-21 15:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 15:35 [PATCH container/qemu-server 0/2] qemu: lxc: refuse moving disks/volumes of protected VMs/CTs Jakob Klocker
2026-09-21 15:35 ` [PATCH pve-container 1/2] api: refuse moving volumes if container is protected Jakob Klocker
2026-09-21 15:35 ` Jakob Klocker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260921153545.406664-3-j.klocker@proxmox.com \
    --to=j.klocker@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal