[pve-devel] [PATCH container] allow width and height parameter for vncproxy

Dominik Csapak d.csapak at proxmox.com
Wed May 24 12:30:48 CEST 2017


so that the novnc console can request a different screen size

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/PVE/API2/LXC.pm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 47dcb08..88cbcd1 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -645,6 +645,20 @@ __PACKAGE__->register_method ({
 		type => 'boolean',
 		description => "use websocket instead of standard VNC.",
 	    },
+	    width => {
+		optional => 1,
+		description => "sets the width of the console in pixels.",
+		type => 'integer',
+		minimum => 16,
+		maximum => 4096,
+	    },
+	    height => {
+		optional => 1,
+		description => "sets the height of the console in pixels.",
+		type => 'integer',
+		minimum => 16,
+		maximum => 2160,
+	    },
 	},
     },
     returns => {
@@ -707,6 +721,14 @@ __PACKAGE__->register_method ({
 		       '-timeout', $timeout, '-authpath', $authpath,
 		       '-perm', 'VM.Console'];
 
+	    if ($param->{width}) {
+		push @$cmd, '-width', $param->{width};
+	    }
+
+	    if ($param->{height}) {
+		push @$cmd, '-height', $param->{height};
+	    }
+
 	    if ($param->{websocket}) {
 		$ENV{PVE_VNC_TICKET} = $ticket; # pass ticket to vncterm
 		push @$cmd, '-notls', '-listen', 'localhost';
-- 
2.11.0





More information about the pve-devel mailing list