]> git.proxmox.com Git - qemu-server.git/commit
usb: refactor usb code and move some into USB module
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 16 Jun 2023 13:05:21 +0000 (15:05 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 16 Jun 2023 14:24:02 +0000 (16:24 +0200)
commit0cf8d56c6df7e6d8896163233b4b7f5558793117
tree9bb2f25dadd2189f674e70e0844c4ba9778fdbda
parente3aad441262b9b33ba7397ba6720235780382c78
usb: refactor usb code and move some into USB module

similar to how we handle the PCI module and format. This makes the
'verify_usb_device' method and format unnecessary since
we simply check the format with a regex.

while doing tihs, i noticed that we don't correctly check for the
case-insensitive variant for 'spice' during hotplug, so fix that too

With this we can also remove some parameters from the get_usb_devices
and get_usb_controllers functions

while were at it, refactor the permission checks for the usb config too
and use the new 'my sub' style for the functions

also make print_usbdevice_full parse the device itself, so we don't have
to do it in multiple places (especially in places where we don't see
that this is needed)

No functional change intended

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-By:  Markus Frank <m.frank@proxmox.com>
PVE/API2/Qemu.pm
PVE/QemuServer.pm
PVE/QemuServer/USB.pm