]> git.proxmox.com Git - pve-cluster.git/commitdiff
add 'mtunnel' to pvecm
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 28 Oct 2016 10:11:32 +0000 (12:11 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 28 Oct 2016 10:16:32 +0000 (12:16 +0200)
This was copied from the 'qm' CLI tool as it uses no functionality
from qemu server itself and will be used in the abstract migrate
class.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/CLI/pvecm.pm

index b26a1eca29298581f5a81fa0599e87ce9c3d3997..624c09613847118be27c56d48d686a716ff09f8b 100755 (executable)
@@ -834,6 +834,35 @@ __PACKAGE__->register_method ({
        return undef;
     }});
 
+__PACKAGE__->register_method ({
+    name => 'mtunnel',
+    path => 'mtunnel',
+    method => 'POST',
+    description => "Used by VM/CT migration - 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;
+    }});
+
 
 our $cmddef = {
     keygen => [ __PACKAGE__, 'keygen', ['filename']],
@@ -845,6 +874,7 @@ our $cmddef = {
     nodes => [ __PACKAGE__, 'nodes' ],
     expected => [ __PACKAGE__, 'expected', ['expected']],
     updatecerts => [ __PACKAGE__, 'updatecerts', []],
+    mtunnel => [ __PACKAGE__, 'mtunnel', []],
 };
 
 1;