]> git.proxmox.com Git - pve-manager-legacy.git/commit
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)
commit9625db757eb6232dadf030fea7656601902c4d19
treea95d9e2d335f4cf8f0726156c15865866300e902
parent5f75921b3df7876165ad82f0258eef5c481b0887
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