Skip to content

Commit

Permalink
q-dev: matches
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Oct 14, 2024
1 parent c6ba8a4 commit 1ad66e5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions qubesadmin/device_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -1233,3 +1233,14 @@ def _deserialize(
properties['device'] = expected_device

return cls(**properties)

def matches(self, device: VirtualDevice) -> bool:
if self.backend_domain != '*' and self.backend_domain != device.backend_domain:
return False
if self.port_id != '*' and self.port_id != device.port_id:
return False
if self.devclass != '*' and self.devclass != device.devclass:
return False
if self.device_id != '*' and self.device_id != device.device_id:
return False
return True

0 comments on commit 1ad66e5

Please sign in to comment.