qubes-core-admin icon indicating copy to clipboard operation
qubes-core-admin copied to clipboard

vm: update only network QDB entries on netvm change

Open nancysangani opened this issue 6 months ago • 8 comments

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().

nancysangani avatar May 08 '26 08:05 nancysangani

/cc @ben-grande /cc @marmarek

nancysangani avatar May 08 '26 08:05 nancysangani

Besides copilot review (see my comments about it), this introduces code duplication. Adjust create_qdb_entries to 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.

nancysangani avatar May 25 '26 08:05 nancysangani

Black complains about minor thing (see CI logs). Otherwise looks much better now. Please squash those two commits together.

marmarek avatar May 25 '26 23:05 marmarek

Black complains about minor thing (see CI logs). Otherwise looks much better now. Please squash those two commits together.

Done, fixed and squashed.

nancysangani avatar May 26 '26 15:05 nancysangani

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 avatar May 26 '26 18:05 marmarek

@marmarek PTAL when you get a chance. Thanks!

nancysangani avatar May 27 '26 15:05 nancysangani

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.

codecov[bot] avatar May 27 '26 20:05 codecov[bot]

The commit message is repeated 3 times... but the commit content itself is good now :)

marmarek avatar May 27 '26 20:05 marmarek