[pve-devel] [PATCH 2/2] disable vnc server and add -nographic is no vga card is present

Alexandre Derumier aderumier at odiso.com
Thu Feb 18 08:14:43 CET 2016


For passthrough, we need to be sure that card is primary,
so we need to disable vnc server

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 70232bf..d1cfb1d 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2813,8 +2813,6 @@ sub config_to_command {
     push @$cmd, '-chardev', "socket,id=qmp,path=$qmpsocket,server,nowait";
     push @$cmd, '-mon', "chardev=qmp,mode=control";
 
-    my $socket = vnc_socket($vmid);
-    push @$cmd,  '-vnc', "unix:$socket,x509,password";
 
     push @$cmd, '-pidfile' , pidfile_name($vmid);
 
@@ -3031,6 +3029,13 @@ sub config_to_command {
 
     push @$cmd, '-vga', $vga if $vga && $vga !~ m/^serial\d+$/; # for kvm 77 and later
 
+    if ($vga && $vga !~ m/^serial\d+$/ && $vga ne 'none'){
+	my $socket = vnc_socket($vmid);
+	push @$cmd,  '-vnc', "unix:$socket,x509,password";
+    } else {
+	push @$cmd, '-nographic';
+    }
+
     # time drift fix
     my $tdf = defined($conf->{tdf}) ? $conf->{tdf} : $defaults->{tdf};
 
-- 
2.1.4




More information about the pve-devel mailing list