From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A441666837 for ; Mon, 27 Jul 2020 15:55:57 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8B0081D4D9 for ; Mon, 27 Jul 2020 15:55:27 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 8B2541D4D0 for ; Mon, 27 Jul 2020 15:55:26 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 54D3D4338B for ; Mon, 27 Jul 2020 15:55:26 +0200 (CEST) From: Aaron Lauterer To: pve-devel@lists.proxmox.com Date: Mon, 27 Jul 2020 15:55:25 +0200 Message-Id: <20200727135525.18622-1-a.lauterer@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.011 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu-server] cfg2cmd: vga: fix #2749: disable edid for Win+BIOS+VGA machines X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 13:55:57 -0000 Edid support was added with Qemu 5. Windows guests seem to not be able to get all possible resolutions if the default std VGA device is used as GPU and the VM boots in BIOS mode. The result is that only one of the following three resolutions can be configured: 800x600 1024x768 1920x1080 It is important to note that just booting a Windows VM with the edid=off parameter will not make the large list of resolutions available. It seems that Windows is caching the list of possible resolutions somewhere [0]. Uninstalling the 'Microsoft Basic Display Adapter' in the device manager and rebooting the VM is one way I found to force Windows to recreate the list of possible resolutions. Signed-off-by: Aaron Lauterer [0] https://lists.nongnu.org/archive/html/qemu-devel/2020-07/msg07128.html --- I did test live migration in both directions and it does seem to work. Would be great if someone else could verify this as well. Not having to version guard this would be nice. PVE/QemuServer.pm | 7 ++++++- test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd | 2 +- test/cfg2cmd/custom-cpu-model.conf.cmd | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 0a09f3a..276dd5f 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -1648,6 +1648,11 @@ sub print_vga_device { $memory = ",ram_size=67108864,vram_size=33554432"; } + my $edidoff = ""; + if ($type eq 'VGA' && windows_version($conf->{ostype})) { + $edidoff=",edid=off" if $conf->{bios} ne 'ovmf'; + } + my $q35 = PVE::QemuServer::Machine::machine_type_is_q35($conf); my $vgaid = "vga" . ($id // ''); my $pciaddr; @@ -1659,7 +1664,7 @@ sub print_vga_device { $pciaddr = print_pci_addr($vgaid, $bridges, $arch, $machine); } - return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}"; + return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}${edidoff}"; } sub parse_number_sets { diff --git a/test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd b/test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd index d8fa254..fb6e8c8 100644 --- a/test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd +++ b/test/cfg2cmd/custom-cpu-model-host-phys-bits.conf.cmd @@ -19,7 +19,7 @@ -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' \ -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' \ -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \ - -device 'VGA,id=vga,bus=pci.0,addr=0x2' \ + -device 'VGA,id=vga,bus=pci.0,addr=0x2,edid=off' \ -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' \ -iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \ -rtc 'driftfix=slew,base=localtime' \ diff --git a/test/cfg2cmd/custom-cpu-model.conf.cmd b/test/cfg2cmd/custom-cpu-model.conf.cmd index 193140f..b30163c 100644 --- a/test/cfg2cmd/custom-cpu-model.conf.cmd +++ b/test/cfg2cmd/custom-cpu-model.conf.cmd @@ -19,7 +19,7 @@ -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' \ -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' \ -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \ - -device 'VGA,id=vga,bus=pci.0,addr=0x2' \ + -device 'VGA,id=vga,bus=pci.0,addr=0x2,edid=off' \ -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' \ -iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \ -rtc 'driftfix=slew,base=localtime' \ -- 2.20.1