Skip to content

Commit a80d27d

Browse files
committed
q-dev: forbid usb assignment options
1 parent f80b8b7 commit a80d27d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

qubesusbproxy/core3ext.py

+8
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,14 @@ async def on_device_detach_usb(self, vm, event, port):
682682
# TODO: sanitize and include stdout
683683
raise QubesUSBException('Device detach failed')
684684

685+
@qubes.ext.handler('device-pre-assign:usb')
686+
async def on_device_assign_usb(self, vm, event, device, options):
687+
# pylint: disable=unused-argument
688+
689+
if options:
690+
raise qubes.exc.QubesException(
691+
'USB device assignment does not support user options')
692+
685693
@qubes.ext.handler('domain-start')
686694
async def on_domain_start(self, vm, _event, **_kwargs):
687695
# pylint: disable=unused-argument

0 commit comments

Comments
 (0)