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)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id C58F776F7A for ; Thu, 21 Oct 2021 10:36:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 505891AA19 for ; Thu, 21 Oct 2021 10:36:19 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 0322B1A9B6 for ; Thu, 21 Oct 2021 10:36:17 +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 CF37445C91 for ; Thu, 21 Oct 2021 10:36:16 +0200 (CEST) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com Date: Thu, 21 Oct 2021 10:36:09 +0200 Message-Id: <20211021083609.2057094-5-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211021083609.2057094-1-t.lamprecht@proxmox.com> References: <20211021083609.2057094-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.195 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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 4/4] cfg2cmd: switch off ACPI hotplug on bridges for q35 VMs 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: Thu, 21 Oct 2021 08:36:19 -0000 See commit 17858a1695 (hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35)[0] in upstream QEMU repository for details about why the change was made. As that change affects systemds predictable interface naming[1], e.g., by going from a previously `ens18` name to `enp6s18`, it may have rather bad effects for users that did not setup some .link files to enforce a specific naming by an more stable information like the NIC's MAC-Address The alternative would be making the preferred mode of hotplug an option like `hotplug-mode=`, but it does not seems like one would like to change that much in the first place... Note the changes to the tests and especially the tests with q35 machines that did not change. [0]: https://gitlab.com/qemu-project/qemu/-/commit/17858a1695 [1]: https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html#Naming Signed-off-by: Thomas Lamprecht --- PVE/QemuServer.pm | 18 ++++++++++++++++++ .../q35-linux-hostpci-multifunction.conf.cmd | 1 + test/cfg2cmd/q35-linux-hostpci.conf.cmd | 1 + test/cfg2cmd/q35-simple.conf.cmd | 1 + test/cfg2cmd/q35-win10-hostpci.conf.cmd | 1 + 5 files changed, 22 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index b10f1b5..84caee7 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3534,6 +3534,24 @@ sub config_to_command { } } + my $meta = parse_meta_info($conf->{meta}) // {}; + # check if we need to apply some handling for VMs that always use the latest machine version but + # had a machine version transition happen that affected HW such that, e.g., an OS config change + # would be required (we do not want to pin machine version for non-windows OS type) + my $create_qemu_vers = $meta->{'creation-qemu'}; + if ( + (!defined($conf->{machine}) || $conf->{machine} =~ m/^(?:pc|q35|virt)$/) # non-versioned machine + && (!defined($create_qemu_vers) || !min_version($create_qemu_vers, 6, 1)) # created before 6.1 + && (!$forcemachine || min_version($forcemachine, 6, 1)) # handle snapshot-rollback/migrations + && min_version($kvmver, 6, 1) # only need to apply the first change with 6.1 + ) { + if ($q35) { + # this changed to default-on in Q 6.1 for q35 machines, it will mess with PCI slot view + # and thus with the predictable interface naming of systemd + push @$cmd, '-global', 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off'; + } + } + if ($conf->{vmgenid}) { push @$devices, '-device', 'vmgenid,guid='.$conf->{vmgenid}; } diff --git a/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd b/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd index 1f9beda..d393906 100644 --- a/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd +++ b/test/cfg2cmd/q35-linux-hostpci-multifunction.conf.cmd @@ -11,6 +11,7 @@ -smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \ -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \ -drive 'if=pflash,unit=1,format=qcow2,id=drive-efidisk0,file=/var/lib/vz/images/100/vm-100-disk-1.qcow2' \ + -global 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' \ -smp '2,sockets=2,cores=1,maxcpus=2' \ -nodefaults \ -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \ diff --git a/test/cfg2cmd/q35-linux-hostpci.conf.cmd b/test/cfg2cmd/q35-linux-hostpci.conf.cmd index dd1bece..5da5c35 100644 --- a/test/cfg2cmd/q35-linux-hostpci.conf.cmd +++ b/test/cfg2cmd/q35-linux-hostpci.conf.cmd @@ -11,6 +11,7 @@ -smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \ -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \ -drive 'if=pflash,unit=1,format=qcow2,id=drive-efidisk0,file=/var/lib/vz/images/100/vm-100-disk-1.qcow2' \ + -global 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' \ -smp '2,sockets=2,cores=1,maxcpus=2' \ -nodefaults \ -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \ diff --git a/test/cfg2cmd/q35-simple.conf.cmd b/test/cfg2cmd/q35-simple.conf.cmd index 5045caf..1c97a89 100644 --- a/test/cfg2cmd/q35-simple.conf.cmd +++ b/test/cfg2cmd/q35-simple.conf.cmd @@ -11,6 +11,7 @@ -smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \ -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \ -drive 'if=pflash,unit=1,format=qcow2,id=drive-efidisk0,file=/var/lib/vz/images/100/vm-100-disk-1.qcow2' \ + -global 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' \ -smp '2,sockets=1,cores=2,maxcpus=2' \ -nodefaults \ -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \ diff --git a/test/cfg2cmd/q35-win10-hostpci.conf.cmd b/test/cfg2cmd/q35-win10-hostpci.conf.cmd index 37ef8f7..843de96 100644 --- a/test/cfg2cmd/q35-win10-hostpci.conf.cmd +++ b/test/cfg2cmd/q35-win10-hostpci.conf.cmd @@ -11,6 +11,7 @@ -smbios 'type=1,uuid=3dd750ce-d910-44d0-9493-525c0be4e687' \ -drive 'if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/pve-edk2-firmware//OVMF_CODE.fd' \ -drive 'if=pflash,unit=1,format=qcow2,id=drive-efidisk0,file=/var/lib/vz/images/100/vm-100-disk-1.qcow2' \ + -global 'ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off' \ -smp '2,sockets=2,cores=1,maxcpus=2' \ -nodefaults \ -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \ -- 2.30.2