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 <[email protected]>
---
 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




Reply via email to