]> git.proxmox.com Git - qemu-server.git/commit
enable cluster mapped USB devices for guests
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 16 Jun 2023 13:05:22 +0000 (15:05 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 16 Jun 2023 14:24:02 +0000 (16:24 +0200)
commite3971865b4735a855123d563bf261954be8f529a
tree479401a0e87b79f5a9495c041e5d04623a50fa23
parent0cf8d56c6df7e6d8896163233b4b7f5558793117
enable cluster mapped USB devices for guests

this patch allows configuring usb devices that are mapped via
cluster resource mapping when the user has 'Mapping.Use' on the ACL
path '/mapping/usb/{ID}' (in addition to the usual required vm config
privileges)

for now, this is only valid if there is exactly one mapping for the
host, since we don't track passed through usb devices yet

This now also checks permissions on clone/restore, meaning a
'non-mapped' device can only be cloned/restored as root@pam user.
That is a breaking change.

Refactor the checks for restoring into a sub, so we have central place
where we can add such checks

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