[pve-devel] r5161 - in qemu-server/pve2: . PVE/API2/Qemu

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Sep 15 12:14:20 CEST 2010


Author: dietmar
Date: 2010-09-15 10:14:20 +0000 (Wed, 15 Sep 2010)
New Revision: 5161

Modified:
   qemu-server/pve2/PVE/API2/Qemu/VNC.pm
   qemu-server/pve2/nqm
Log:


Modified: qemu-server/pve2/PVE/API2/Qemu/VNC.pm
===================================================================
--- qemu-server/pve2/PVE/API2/Qemu/VNC.pm	2010-09-15 10:08:40 UTC (rev 5160)
+++ qemu-server/pve2/PVE/API2/Qemu/VNC.pm	2010-09-15 10:14:20 UTC (rev 5161)
@@ -13,16 +13,14 @@
 use PVE::QemuServer;
 use PVE::RPCEnvironment;
 
-use Data::Dumper; # fixme: remove
-
-
 use base qw(PVE::RESTHandler);
 
 __PACKAGE__->register_method ({
     name => 'vncproxy', 
     path => '',  
     method => 'POST',
-    description => "Create VNC proxy connections.",
+    protected => 1,
+    description => "Creates a TCP VNC proxy connections.",
     parameters => {
     	additionalProperties => 0,
 	properties => {
@@ -69,8 +67,6 @@
 	    # also redirect stderr (else we get RFB protocol errors)
 	    my @cmd = ('/bin/nc', '-l', '-p', $port, '-w', $timeout, '-c', "$qmstr 2>/dev/null");
 
-	    unshift @cmd, "echo"; # fixme
-
 	    my $cmdstr = join (' ', @cmd);
 	    syslog ('info', "CMD: $cmdstr");
 

Modified: qemu-server/pve2/nqm
===================================================================
--- qemu-server/pve2/nqm	2010-09-15 10:08:40 UTC (rev 5160)
+++ qemu-server/pve2/nqm	2010-09-15 10:14:20 UTC (rev 5161)
@@ -152,7 +152,7 @@
     name => 'vncproxy', 
     path => 'vncproxy', 
     method => 'PUT',
-    description => "Run a VNC proxy ",
+    description => "Proxy VM VNC traffic to stdin/stdout",
     parameters => {
     	additionalProperties => 0,
 	properties => {
@@ -352,14 +352,16 @@
 
 	    next if $input =~ m/^\s*$/;
 
-	    if ($input =~ m/^\s*q(uit)?\s*$/) {
-		exit (0);
-	    }
+	    last if $input =~ m/^\s*q(uit)?\s*$/;
+
 	    eval {
 		print PVE::QemuServer::vm_monitor_command ($vmid, $input);
 	    };
 	    print "ERROR: $@" if $@;
 	}
+
+	return undef;
+
     }});
 
 # fixme: unlink



More information about the pve-devel mailing list