Skip to content

Commit

Permalink
q-dev: async confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Oct 14, 2024
1 parent 6d02716 commit 4876f2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qubesusbproxy/core3ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,10 @@ async def attach_and_notify(self, vm, assignment):
# bypass DeviceCollection logic preventing double attach
device = assignment.device
if assignment.mode.value == "ask-to-attach":
if vm.name != utils.confirm_device_attachment(
device, {vm: assignment}):
allowed = await utils.confirm_device_attachment(
device, {vm: assignment})
allowed = allowed.strip()
if vm.name != allowed:
return
await self.on_device_attach_usb(
vm, 'device-pre-attach:usb', device, assignment.options)
Expand Down

0 comments on commit 4876f2a

Please sign in to comment.