Skip to content

Commit

Permalink
Make "multimedia" devices more detailed
Browse files Browse the repository at this point in the history
Distinguish between audio, video and display adapters. This is
especially relevant when setting up sys-audio or sys-gui-gpu, otherwise
it's hard to find which "multimedia" device is the right one.
  • Loading branch information
marmarek committed Nov 25, 2024
1 parent ab72538 commit 95a2f69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions qubesadmin/device_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,13 +646,14 @@ class DeviceCategory(Enum):
Microphone = ("m******",)
# Multimedia = Audio, Video, Displays etc.
Multimedia = (
"u01****",
"u0e****",
"u06****",
"u10****",
"p03****",
"p04****",
)
Audio = ("p0403**", "u01****")
Display = ("p0300**", "p0380**")
Video = ("p0400**", "u0e****")
Wireless = ("ue0****", "p0d****")
Bluetooth = ("ue00101", "p0d11**")
Storage = ("b******", "u08****", "p01****")
Expand Down
6 changes: 3 additions & 3 deletions qubesadmin/tests/tools/qvm_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_000_list_all(self):
['testclass', 'list'], app=self.app)
self.assertEqual(
[x.rstrip() for x in buf.getvalue().splitlines()],
['test-vm1:dev1 Multimedia: itl test-device',
['test-vm1:dev1 Audio: itl test-device',
'test-vm2:dev2 ?******: ? ` test-device']
)

Expand Down Expand Up @@ -151,7 +151,7 @@ def test_002_list_attach(self):
['testclass', 'list', 'test-vm3'], app=self.app)
self.assertEqual(
buf.getvalue(),
'test-vm1:dev1 Multimedia: itl test-device '
'test-vm1:dev1 Audio: itl test-device '
'test-vm3 (attached)\n'
)

Expand Down Expand Up @@ -564,6 +564,6 @@ def test_060_device_info(self):
qubesadmin.tools.qvm_device.main(
['testclass', 'info', 'test-vm1:dev1'],
app=self.app)
self.assertIn('Multimedia: itl test-device\ndevice ID: dead:beef:babe:u012345',
self.assertIn('Audio: itl test-device\ndevice ID: dead:beef:babe:u012345',
buf.getvalue())
self.assertAllCalled()

0 comments on commit 95a2f69

Please sign in to comment.