From 90945610525612db0aedd2b5ea43029306af691a Mon Sep 17 00:00:00 2001 From: Piotr Bartman-Szwarc Date: Sat, 18 May 2024 18:54:51 +0200 Subject: [PATCH] q-dev: fix attaching usb devices on domain start --- qubesusbproxy/core3ext.py | 4 ++-- qubesusbproxy/tests.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qubesusbproxy/core3ext.py b/qubesusbproxy/core3ext.py index 01aa910..9aea5f3 100644 --- a/qubesusbproxy/core3ext.py +++ b/qubesusbproxy/core3ext.py @@ -609,8 +609,8 @@ async def on_device_detach_usb(self, vm, event, device): async def on_domain_start(self, vm, _event, **_kwargs): # pylint: disable=unused-argument for assignment in vm.devices['usb'].get_assigned_devices(): - asyncio.ensure_future(self.attach_and_notify( - vm, assignment.device, assignment.options)) + await self.attach_and_notify( + vm, assignment.device, assignment.options) @qubes.ext.handler('domain-shutdown') async def on_domain_shutdown(self, vm, _event, **_kwargs): diff --git a/qubesusbproxy/tests.py b/qubesusbproxy/tests.py index a268219..30b1d98 100644 --- a/qubesusbproxy/tests.py +++ b/qubesusbproxy/tests.py @@ -395,7 +395,7 @@ def test_010_assign(self): wait=True), 0, "Device connection failed") - self.assertEquals(usb_dev.attachment, + self.assertEqual(usb_dev.attachment, self.frontend) def test_020_attach(self):