From 3deccbd7d0c9860ce13aadfa902b422e907171cc Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 10 Nov 2022 15:35:55 +0100 Subject: [PATCH] USB: use machine_type_is_q35 instead of regex we refactored that into PVE::QemuServer::Machine a while ago, so we can use it here Signed-off-by: Dominik Csapak --- 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 b669c919..10c9bca1 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";