diff --git a/qui/devices/backend.py b/qui/devices/backend.py index d424edce..1dfaacd9 100644 --- a/qui/devices/backend.py +++ b/qui/devices/backend.py @@ -229,9 +229,8 @@ def attach_to_vm(self, vm: VM): Perform attachment to provided VM. """ try: - assignment = qubesadmin.devices.DeviceAssignment( - self.backend_domain, self.id_string, - persistent=False) + assignment = qubesadmin.device_protocol.DeviceAssignment( + self.backend_domain, self.id_string) vm.vm_object.devices[self.device_class].attach(assignment) self.gtk_app.emit_notification( @@ -261,9 +260,8 @@ def detach_from_vm(self, vm: VM): Gio.NotificationPriority.NORMAL, notification_id=self.notification_id) try: - assignment = qubesadmin.devices.DeviceAssignment( - self.backend_domain, self._ident, - persistent=False) + assignment = qubesadmin.device_protocol.DeviceAssignment( + self.backend_domain, self._ident) vm.vm_object.devices[self.device_class].detach(assignment) except qubesadmin.exc.QubesException as ex: self.gtk_app.emit_notification( diff --git a/qui/devices/device_widget.py b/qui/devices/device_widget.py index 4fcc66f9..386b282d 100644 --- a/qui/devices/device_widget.py +++ b/qui/devices/device_widget.py @@ -179,7 +179,8 @@ def initialize_dev_data(self): for domain in self.qapp.domains: for devclass in DEV_TYPES: try: - for device in domain.devices[devclass].attached(): + for device in domain.devices[devclass + ].get_attached_devices(): dev = str(device) if dev in self.devices: # occassionally ghost UnknownDevices appear when a @@ -227,7 +228,7 @@ def vm_start(self, vm, _event, **_kwargs): for devclass in DEV_TYPES: try: - for device in vm.devices[devclass].attached(): + for device in vm.devices[devclass].get_attached_devices(): dev = str(device) if dev in self.devices: self.devices[dev].attachments.add(wrapped_vm)