[pve-devel] [PATCH qemu-server 4/7] USB: use machine_type_is_q35 instead of regex
Dominik Csapak
d.csapak at proxmox.com
Thu Nov 10 15:35:55 CET 2022
we refactored that into PVE::QemuServer::Machine a while ago, so we can
use it here
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
PVE/QemuServer/USB.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/PVE/QemuServer/USB.pm b/PVE/QemuServer/USB.pm
index b669c91..10c9bca 100644
--- a/PVE/QemuServer/USB.pm
+++ b/PVE/QemuServer/USB.pm
@@ -3,6 +3,7 @@ package PVE::QemuServer::USB;
use strict;
use warnings;
use PVE::QemuServer::PCI qw(print_pci_addr);
+use PVE::QemuServer::Machine;
use PVE::JSONSchema;
use base 'Exporter';
@@ -42,7 +43,7 @@ sub get_usb_controllers {
if ($arch eq 'aarch64') {
$pciaddr = print_pci_addr('ehci', $bridges, $arch, $machine);
push @$devices, '-device', "usb-ehci,id=ehci$pciaddr";
- } elsif ($machine !~ /q35/) { # FIXME: combine this and machine_type_is_q35
+ } elsif (!PVE::QemuServer::Machine::machine_type_is_q35($conf)) {
$pciaddr = print_pci_addr("piix3", $bridges, $arch, $machine);
push @$devices, '-device', "piix3-usb-uhci,id=uhci$pciaddr.0x2";
--
2.30.2
More information about the pve-devel
mailing list