Fix devices handling with RemoteVM present#846
Conversation
It doesn't have libvirt_domain attribute, so skip it early when looking to where a given device is attached. QubesOS/qubes-issues#10915
RemoteVM doesn't have devices. When listing devices (either exposed or attached) simply return an empty list (this was already mostly done, but one place was missing). But when trying to attach/detach, return an error early. Fixes: aa714dd "Fix devices and other behavior for remotevms" Fixes QubesOS/qubes-issues#10915
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #846 +/- ##
==========================================
- Coverage 70.39% 70.37% -0.02%
==========================================
Files 61 61
Lines 14169 14179 +10
==========================================
+ Hits 9974 9979 +5
- Misses 4195 4200 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| else: | ||
| device_assignments = self.dest.devices[ | ||
| devclass | ||
| ].get_attached_devices() |
There was a problem hiding this comment.
What about:
device_assignments = []
if hasattr(self.dest, "devices") and devclass in self.dest.devices:
self.dest.devices[devclass].get_attached_devices()So we don't have to check for the klass explictly.
There was a problem hiding this comment.
Earlier version of this commit did it like this, but it has an unfortunate side effect - accessing devices attribute during qubesd restart may throw AttributeError too, and the version with hasattr would result in a successful answer listing no devices. This, at the very least would result in a wrong state of the devices widget (and it won't be fixed soon, as there won't be events about new devices just because it got erroneously an empty list once).
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026072016-devel&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026050504-devel&flavor=update
Failed tests15 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/176874#dependencies 21 fixed
Unstable testsDetails
Performance TestsPerformance degradation:28 performance degradations
Remaining performance tests:83 tests
|
Fixes QubesOS/qubes-issues#10915