Skip to content

Commit

Permalink
q-dev: fix global config
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Apr 28, 2024
1 parent 42d0402 commit 9996d14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions qubes_config/global_config/usb_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from typing import List, Union, Optional, Dict, Tuple, Set

from qrexec.policy.parser import Allow
from qubesadmin.device_protocol import DeviceCategory

from ..widgets.gtk_widgets import TokenName, TextModeler, VMListModeler
from ..widgets.utils import get_feature, apply_feature_change
Expand Down Expand Up @@ -628,7 +629,7 @@ def __init__(self,
qapp: qubesadmin.Qubes,
policy_manager: PolicyManager,
gtk_builder: Gtk.Builder
):
):
self.qapp = qapp
self.policy_manager = policy_manager

Expand All @@ -637,8 +638,9 @@ def __init__(self,
usb_qubes: Set[qubesadmin.vm.QubesVM] = set()

for vm in self.qapp.domains:
for device in vm.devices['pci'].get_attached_devices():
if device.description.startswith('USB controller'):
for assignment in vm.devices['pci'].get_attached_devices():
if any(infc.category for infc in assignment.device.interfaces
) == DeviceCategory.PCI_USB:
usb_qubes.add(vm)

self.input_handler = InputDeviceHandler(
Expand Down

0 comments on commit 9996d14

Please sign in to comment.