Skip to content

Commit

Permalink
q-dev: make devclass required
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Oct 14, 2024
1 parent ac42e08 commit 8e90d90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions qubesadmin/device_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def serialize(self) -> bytes:
('devclass', self.devclass)))

properties += b' ' + DeviceSerializer.pack_property(
'backend_domain', self.backend_domain.name)
'backend_domain', self.backend_name)

return properties

Expand Down Expand Up @@ -1252,12 +1252,12 @@ def _deserialize(
return cls(**properties)

def matches(self, device: VirtualDevice) -> bool:
if self.devclass != device.devclass:
return False
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
2 changes: 1 addition & 1 deletion qubesadmin/tools/qvm_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def assign_device(args):
if args.only_port:
device.device_id = None
if args.only_device:
device.port = None
device.port = Port(None, None, device.devclass)
options = dict(opt.split('=', 1) for opt in args.option or [])
if args.ro:
options['read-only'] = 'yes'
Expand Down

0 comments on commit 8e90d90

Please sign in to comment.