public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 4/6] mtunnel: add 'conf' command to do strict configuration parsing
Date: Fri, 20 Feb 2026 14:36:12 +0100	[thread overview]
Message-ID: <20260220133911.135593-5-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260220133911.135593-1-f.ebner@proxmox.com>

Will be requested by the source of the migration before the
configuration is moved, so there is a parameter for the node where
the configuration resides.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/CLI/qm.pm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/PVE/CLI/qm.pm b/src/PVE/CLI/qm.pm
index 2b42c3b4..8498d0c5 100755
--- a/src/PVE/CLI/qm.pm
+++ b/src/PVE/CLI/qm.pm
@@ -18,6 +18,7 @@ use URI::Escape;
 use PVE::APIClient::LWP;
 use PVE::Cluster;
 use PVE::Exception qw(raise_param_exc);
+use PVE::File;
 use PVE::GuestHelpers;
 use PVE::GuestImport::OVF;
 use PVE::INotify;
@@ -477,6 +478,18 @@ __PACKAGE__->register_method({
                 } else {
                     $tunnel_write->("ERR: resume failed - VM $vmid not running");
                 }
+            } elsif ($line =~ /^config (\d+) (\S+)$/) {
+                my ($vmid, $node) = ($1, $2);
+                eval {
+                    my $conf_fn = PVE::QemuConfig->config_file($vmid, $node);
+                    my $raw = PVE::File::file_get_contents($conf_fn);
+                    PVE::QemuServer::parse_vm_config($conf_fn, $raw, 1);
+                };
+                if (my $err = $@) {
+                    $tunnel_write->("ERR: strict config check for target node failed - $err");
+                } else {
+                    $tunnel_write->("OK");
+                }
             }
         }
 
-- 
2.47.3





  parent reply	other threads:[~2026-02-20 13:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20 13:36 [PATCH-SERIES qemu-server 0/6] migration: strict config check for intra-cluster migration Fiona Ebner
2026-02-20 13:36 ` [PATCH qemu-server 1/6] d/control: bump versioned build dependency for libpve-common-perl to 9.0.12 Fiona Ebner
2026-02-20 13:36 ` [PATCH qemu-server 2/6] tests: migration: get rid of mocking for removed PVE::QemuMigrate::read_tunnel() Fiona Ebner
2026-02-20 13:36 ` [PATCH qemu-server 3/6] qm: mtunnel: avoid using deprecated check_running() helper Fiona Ebner
2026-02-20 13:36 ` Fiona Ebner [this message]
2026-02-20 13:36 ` [PATCH qemu-server 5/6] qm: mtunnel: reply when a command is unknown Fiona Ebner
2026-02-20 13:36 ` [PATCH qemu-server 6/6] migration: intra-cluster: check config can be parsed on target node Fiona Ebner

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=20260220133911.135593-5-f.ebner@proxmox.com \
    --to=f.ebner@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