From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 2/5] usb: drop always-true spice_usb3 feature flag
Date: Thu, 15 Oct 2026 09:52:16 +0200 [thread overview]
Message-ID: <20261015075428.572882-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20261015075428.572882-1-d.csapak@proxmox.com>
The 'spice_usb3' feature was only set for machine versions 4.0 and
newer. Since config_to_command refuses to start machines older than
5.0, the flag is always set, so a SPICE USB port with 'usb3' enabled
always ends up on the xhci controller anyway.
Drop the feature hash from get_usb_devices and check 'usb3' directly.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/PVE/QemuServer.pm | 8 +-------
src/PVE/QemuServer/USB.pm | 4 ++--
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 7e5f7bbb..097c88b6 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -3325,13 +3325,7 @@ sub config_to_command {
$vmid, $conf, $devices, $vga, $winversion, $arch, $bootorder, $dry_run,
);
- # usb devices
- my $usb_dev_features = {};
- $usb_dev_features->{spice_usb3} = 1 if min_version($machine_version, 4, 0);
-
- my @usbdevices = PVE::QemuServer::USB::get_usb_devices(
- $conf, $usb_dev_features, $bootorder, $machine_version,
- );
+ my @usbdevices = PVE::QemuServer::USB::get_usb_devices($conf, $bootorder, $machine_version);
push @$devices, @usbdevices if @usbdevices;
# serial devices
diff --git a/src/PVE/QemuServer/USB.pm b/src/PVE/QemuServer/USB.pm
index d75507e4..bf2741f6 100644
--- a/src/PVE/QemuServer/USB.pm
+++ b/src/PVE/QemuServer/USB.pm
@@ -168,7 +168,7 @@ sub get_usb_controllers {
}
sub get_usb_devices {
- my ($conf, $features, $bootorder, $machine_version) = @_;
+ my ($conf, $bootorder, $machine_version) = @_;
my $devices = [];
@@ -190,7 +190,7 @@ sub get_usb_devices {
if ($d->{host} && $d->{host} =~ m/^spice$/) {
# usb redir support for spice
my $bus = 'ehci';
- $bus = 'xhci' if ($d->{usb3} && $features->{spice_usb3}) || $use_qemu_xhci;
+ $bus = 'xhci' if $d->{usb3} || $use_qemu_xhci;
push @$devices, '-chardev', "spicevmc,id=usbredirchardev$i,name=usbredir";
push @$devices, '-device', print_spice_usbdevice($i, $bus, $port);
--
2.47.3
next prev parent reply other threads:[~2026-10-15 7:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 7:52 [PATCH qemu-server 0/5] small cleanup/refactor/fixes Dominik Csapak
2026-10-15 7:52 ` [PATCH qemu-server 1/5] helpers: factor out the version parts parsing Dominik Csapak
2026-10-15 7:52 ` Dominik Csapak [this message]
2026-10-15 7:52 ` [PATCH qemu-server 3/5] net: use version guard for the machine version checks of NICs Dominik Csapak
2026-10-15 7:52 ` [PATCH qemu-server 4/5] usb: factor out the default usb bus of the tablet Dominik Csapak
2026-10-15 7:52 ` [PATCH qemu-server 5/5] drive device: check the machine version for blockdev only once Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261015075428.572882-3-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox