Skip to content

Commit

Permalink
q-dev: fix block auto-attach
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Oct 14, 2024
1 parent e3b1cf8 commit 5f76980
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion qubesadmin/device_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ def serialize(self) -> bytes:
if getattr(self, key) != getattr(default, key)))

if self.attachment:
properties = DeviceSerializer.pack_property(
properties += b' ' + DeviceSerializer.pack_property(
'attachment', self.attachment.name)

properties += b' ' + DeviceSerializer.pack_property(
Expand Down Expand Up @@ -1142,6 +1142,8 @@ def devices(self) -> List[DeviceInfo]:
# could return UnknownDevice
return [self.backend_domain.devices[self.devclass][self.port_id]]
result = []
if self.device_id == "0000:0000::?******":
return result
for dev in self.backend_domain.devices[self.devclass]:
if dev.device_id == self.device_id:
result.append(dev)
Expand Down
2 changes: 1 addition & 1 deletion qubesadmin/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def handle(self, subject, event, **kwargs):
self.app.domains,
blind=True)
kwargs['device'] = self.app.domains.get_blind(
device.backend_domain).devices[devclass][device.port_id]
device.backend_name).devices[devclass][device.port_id]
if 'port' in kwargs:
devclass = event.split(':', 1)[1]
kwargs['port'] = Port.from_str(
Expand Down

0 comments on commit 5f76980

Please sign in to comment.