qemu-xhci is to be preferred to nec-usb-xhci, but for compatibility reasons, only use it for machine types >= 7.1 and ostypes l26 and windows > 7 (older os' don't support it) (depending on that machine version should be ok as long as we don't roll out qemu 7.1 before applying this series)
With that controller we can specify how many ports we want (we chose 15, the maximum) and for those guests we now set the usb devices on fixed ports (usb0 gets port 1 and so on) so that we can enable hotplugging too. Lastly, since we set the maximum of 15 ports, we can safely use up to 14 of them (without qemu plugging a usb-hub in between) For hotplugging we check the actual running qemu machine version, but the gui only uses a heuristic based on the config (still good enough since it allows more than the back end) For guests with older machine types or other ostypes, the current behaviour remains Note: patch 1,2 of qemu-server are only cleanups/refactor that could be applied independently (no behaviour change intended) patch 1 of pve-manager could be squashed into 2, but if we decide not to use that heuristic in the gui, can be applied separately qemu-server: Dominik Csapak (7): print_tabletdevice_full: make use of $q35 variable move 'windows_version' to Helpers USB: print_usbdevice_full: error out on invalid configuration USB: use machine_type_is_q35 instead of regex fix #4324: USB: use qemu-xhci for machine versions >= 7.1 USB: increase max usb devices to 14 for newer machine version and ostype fix #3271: USB: allow usb hotplugging for modern guests PVE/API2/Qemu.pm | 2 +- PVE/QemuServer.pm | 134 ++++++++++++++++------------ PVE/QemuServer/Cloudinit.pm | 3 +- PVE/QemuServer/Helpers.pm | 19 ++++ PVE/QemuServer/USB.pm | 94 ++++++++++++++----- test/cfg2cmd/qemu-xhci-7.1.conf | 12 +++ test/cfg2cmd/qemu-xhci-7.1.conf.cmd | 34 +++++++ 7 files changed, 220 insertions(+), 78 deletions(-) create mode 100644 test/cfg2cmd/qemu-xhci-7.1.conf create mode 100644 test/cfg2cmd/qemu-xhci-7.1.conf.cmd pve-manager: Dominik Csapak (2): ui: USBInputPanel: use correct maximum usb index ui: qemu: increase available usb ports depending on machine and ostype www/manager6/Utils.js | 53 ++++++++++++++++++++++++++++++- www/manager6/qemu/HardwareView.js | 7 +++- www/manager6/qemu/USBEdit.js | 7 +++- 3 files changed, 64 insertions(+), 3 deletions(-) -- 2.30.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel