vm: update only network QDB entries on netvm change
Fixes QubesOS/qubes-issues#9892
When netvm changes, on_property_set_netvm() called create_qdb_entries() which fires domain-qdb-create and rewrites all QubesDB entries including /keyboard-layout, resetting any custom layout set by the user.
Add update_qdb_netvm_entries() in QubesVM that writes only the network-related QubesDB entries (IP, gateway, netmask, DNS, MAC). Use this in on_property_set_netvm() instead of create_qdb_entries().
/cc @ben-grande /cc @marmarek
Besides copilot review (see my comments about it), this introduces code duplication. Adjust
create_qdb_entriesto call the new function in place of the copied code.
Done — create_qdb_entries() now calls update_qdb_netvm_entries() instead of duplicating the network entries code.
Black complains about minor thing (see CI logs). Otherwise looks much better now. Please squash those two commits together.
Black complains about minor thing (see CI logs). Otherwise looks much better now. Please squash those two commits together.
Done, fixed and squashed.
Done, fixed
Not really... note we use 80 chars line length.
squashed
This also didn't work, now here are 3 commits. Take a look here for example: https://stackoverflow.com/a/5189600
@marmarek PTAL when you get a chance. Thanks!
Codecov Report
:x: Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 70.40%. Comparing base (71b5ab2) to head (f5ac222).
:warning: Report is 11 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| qubes/vm/qubesvm.py | 94.44% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #808 +/- ##
==========================================
+ Coverage 70.24% 70.40% +0.16%
==========================================
Files 61 61
Lines 14073 14110 +37
==========================================
+ Hits 9885 9934 +49
+ Misses 4188 4176 -12
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 70.40% <94.73%> (+0.16%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
The commit message is repeated 3 times... but the commit content itself is good now :)