[pve-devel] [PATCH qemu-server 3/3] remove deprecated 'qm mtunnel' replaced by 'pvecm mtunnel'

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Oct 27 17:00:20 CEST 2016


This moves also the tunnel for ssh secured migration to the pvecm
mtunnel call, simply to avoid code duplication.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 PVE/CLI/qm.pm      | 31 -------------------------------
 PVE/QemuMigrate.pm |  2 +-
 2 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
index a0e0ba5..f3cb9ba 100755
--- a/PVE/CLI/qm.pm
+++ b/PVE/CLI/qm.pm
@@ -220,35 +220,6 @@ __PACKAGE__->register_method ({
     }});
 
 __PACKAGE__->register_method ({
-    name => 'mtunnel',
-    path => 'mtunnel',
-    method => 'POST',
-    description => "Used by qmigrate - do not use manually.",
-    parameters => {
-	additionalProperties => 0,
-	properties => {},
-    },
-    returns => { type => 'null'},
-    code => sub {
-	my ($param) = @_;
-
-	if (!PVE::Cluster::check_cfs_quorum(1)) {
-	    print "no quorum\n";
-	    return undef;
-	}
-
-	print "tunnel online\n";
-	*STDOUT->flush();
-
-	while (my $line = <>) {
-	    chomp $line;
-	    last if $line =~ m/^quit$/;
-	}
-
-	return undef;
-    }});
-
-__PACKAGE__->register_method ({
     name => 'wait',
     path => 'wait',
     method => 'GET',
@@ -529,8 +500,6 @@ our $cmddef = {
 
     monitor  => [ __PACKAGE__, 'monitor', ['vmid']],
 
-    mtunnel => [ __PACKAGE__, 'mtunnel', []],
-
     terminal => [ __PACKAGE__, 'terminal', ['vmid']],
 };
 
diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 20e98a6..5ea28f6 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -93,7 +93,7 @@ sub fork_tunnel {
 
     my @localtunnelinfo = defined($tunnel_addr) ? ('-L' , $tunnel_addr ) : ();
 
-    my $cmd = [@{$self->{rem_ssh}}, '-o ExitOnForwardFailure=yes', @localtunnelinfo, 'qm', 'mtunnel' ];
+    my $cmd = [@{$self->{rem_ssh}}, '-o ExitOnForwardFailure=yes', @localtunnelinfo, 'pvecm', 'mtunnel' ];
 
     my $tunnel = $self->fork_command_pipe($cmd);
 
-- 
2.1.4





More information about the pve-devel mailing list