]> git.proxmox.com Git - pve-manager.git/commit - www/manager6/Utils.js
ui: qemu: increase available usb ports depending on machine and ostype
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 10 Nov 2022 14:36:00 +0000 (15:36 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 10 Nov 2022 16:06:41 +0000 (17:06 +0100)
commit17dcba38dd7a5f35ed92d1b5147a374253b58437
tree2711da71b7bf8d98326c9db4de2eaa896adab98f
parent988898a6251b02863dee74ce47e37450efdc409b
ui: qemu: increase available usb ports depending on machine and ostype

in the backend, we allow up to 14 usb ports, but only if the vm can
use the qemu-xhci controller which is only possible since machine
version 7.1 and if the ostype is l26 or windows > 7

for this we introduce two helpers:
* qemu_min_version: modeled after the signature of 'min_version' from
  qemu-server, expects two arrays of versions and returns true if
  the first parameter is equal or greater than the second version
* get_max_usb_count looks at the given ostype and machine string
  and returns the proper maximum number

since we don't currently have the actual running version of the vm in
the gui, this is only a heuristic for running vms. but since the actual
running version could only be lower if none is set (e.g. for
migrated/long-running vms) we allow more in the gui and the backend will
do the proper thing (either hotplug it, or make it a pending change)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Utils.js
www/manager6/qemu/HardwareView.js
www/manager6/qemu/USBEdit.js