Skip to content

Add boot mode support#407

Merged
marmarek merged 2 commits into
QubesOS:mainfrom
ArrayBolt3:main
Mar 15, 2025
Merged

Add boot mode support#407
marmarek merged 2 commits into
QubesOS:mainfrom
ArrayBolt3:main

Conversation

@ArrayBolt3

Copy link
Copy Markdown
Contributor

Adds the user interface elements described at QubesOS/qubes-issues#9750 (comment) to the settings UI.

Not fully tested, thus not ready for merge. It seems to work for the most part, but my PR for the backend has a problem that keeps me from changing AppVM's templates for some reason.

@ArrayBolt3

Copy link
Copy Markdown
Contributor Author

Figured out the bug. From a UX standpoint this seems done at least when doing a quick smoke test. Will do more thorough testing on this and QubesOS/qubes-core-admin#653 and hopefully mark as ready for review tomorrow.

@ArrayBolt3

Copy link
Copy Markdown
Contributor Author

This is now ready for review. This should be merged with the corresponding backend PR, QubesOS/qubes-core-admin#653.

@ArrayBolt3

Copy link
Copy Markdown
Contributor Author

Sigh, my Git acrobatics seems to have confused GitHub...

Comment thread qubesmanager/settings.py Outdated
@ArrayBolt3

Copy link
Copy Markdown
Contributor Author

Just fixed a label formatting issue.

@marmarek

marmarek commented Mar 2, 2025

Copy link
Copy Markdown
Member

As a side effect you made the window quite tall. The basic one has a lot of padding at the bottom now, and similarly even on the advanced tab too. And the buttons don't fit on (small) screen: https://openqa.qubes-os.org/tests/131086#step/guivm_manager/27

@qubesos-bot

qubesos-bot commented Mar 3, 2025

Copy link
Copy Markdown

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025031404-4.3&flavor=pull-requests

Test run included the following:

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025021804-4.3&flavor=update

  • system_tests_whonix

  • system_tests_qrexec

    • TC_00_Qrexec_fedora-41-xfce: test_065_qrexec_exit_code_vm (failure)
      ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^... AssertionError: b'125\n' != b'0\n'
  • system_tests_dispvm

    • TC_20_DispVM_whonix-workstation-17: test_100_open_in_dispvm (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError
  • system_tests_kde_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "echo -e '[Layout]\nLayoutList=us,de' | sud...

    • gui_keyboard_layout: Failed (test died)
      # Test died: command 'test "$(cd ~user;ls e1*)" = "$(qvm-run -p wor...

  • system_tests_audio

  • system_tests_whonix@hw7

  • system_tests_qwt_win11@hw13

    • windows_install: wait_serial (wait serial expected)
      # wait_serial expected: qr/GrZKv-\d+-/...

    • windows_install: Failed (test died + timed out)
      # Test died: command 'script -e -c 'qvm-create-windows-qube -i Win...

  • system_tests_basic_vm_qrexec_gui_btrfs

  • system_tests_qwt_win10_seamless@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'windows-Explorer-empt...
  • system_tests_qwt_win10@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'clipboard-paste-notif...

Failed tests

25 failures
  • system_tests_whonix

    • whonixcheck: fail (unknown)
      Whonixcheck for anon-whonix failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • whonixcheck: unnamed test (unknown)

  • system_tests_qrexec

    • TC_00_Qrexec_fedora-41-xfce: test_065_qrexec_exit_code_vm (failure)
      ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^... AssertionError: b'125\n' != b'0\n'
  • system_tests_dispvm

    • TC_20_DispVM_whonix-workstation-17: test_100_open_in_dispvm (error + cleanup)
      raise TimeoutError from exc_val... TimeoutError
  • system_tests_kde_gui_interactive

    • gui_keyboard_layout: wait_serial (wait serial expected)
      # wait_serial expected: "echo -e '[Layout]\nLayoutList=us,de' | sud...

    • gui_keyboard_layout: Failed (test died)
      # Test died: command 'test "$(cd ~user;ls e1*)" = "$(qvm-run -p wor...

  • system_tests_audio

  • system_tests_whonix@hw7

    • whonixcheck: fail (unknown)
      Whonixcheck for anon-whonix failed...

    • whonixcheck: unnamed test (unknown)

    • whonixcheck: fail (unknown)
      Whonixcheck for sys-whonix failed...

    • whonixcheck: unnamed test (unknown)

  • system_tests_qwt_win11@hw13

    • windows_install: wait_serial (wait serial expected)
      # wait_serial expected: qr/GrZKv-\d+-/...

    • windows_install: Failed (test died + timed out)
      # Test died: command 'script -e -c 'qvm-create-windows-qube -i Win...

  • system_tests_basic_vm_qrexec_gui_btrfs

  • system_tests_suspend@hw1

    • suspend: unnamed test (unknown)
    • suspend: Failed (test died)
      # Test died: no candidate needle with tag(s) 'SUSPEND-FAILED' match...
  • system_tests_qwt_win10_seamless@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'windows-Explorer-empt...
  • system_tests_qwt_win10@hw13

    • windows_clipboard_and_filecopy: unnamed test (unknown)
    • windows_clipboard_and_filecopy: Failed (test died)
      # Test died: no candidate needle with tag(s) 'clipboard-paste-notif...

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/129058#dependencies

10 fixed
  • system_tests_whonix

  • system_tests_suspend

    • suspend: unnamed test (unknown)
    • suspend: Failed (test died)
      # Test died: no candidate needle with tag(s) 'SUSPEND-FAILED' match...
  • system_tests_qrexec

  • system_tests_kde_gui_interactive

    • clipboard_and_web: unnamed test (unknown)
    • clipboard_and_web: Failed (test died)
      # Test died: no candidate needle with tag(s) 'clipboard-paste-notif...
  • system_tests_audio

    • TC_20_AudioVM_Pulse_whonix-workstation-17: test_223_audio_play_hvm (failure)
      AssertionError: too short audio, expected 10s, got 7.33528344671201...

    • TC_20_AudioVM_PipeWire_whonix-workstation-17: test_226_audio_playback_pipewire (failure)
      AssertionError: too short audio, expected 10s, got 9.19027210884353...

  • system_tests_whonix@hw7

  • system_tests_basic_vm_qrexec_gui_btrfs

    • TC_03_QvmRevertTemplateChanges: test_000_revert_linux (error)
      subprocess.CalledProcessError: Command '['sha1sum', '/var/lib/qubes...

Unstable tests

Details

Performance Tests

Performance degradation:

32 performance degradations
  • debian-12-xfce_exec-data-simplex: 72.89 :small_red_triangle_up: ( previous job: 48.93, degradation: 148.97%)
  • debian-12-xfce_exec-data-duplex: 63.68 :small_red_triangle_up: ( previous job: 50.76, degradation: 125.45%)
  • debian-12-xfce_exec-data-duplex-root: 80.12 :small_red_triangle_up: ( previous job: 64.91, degradation: 123.44%)
  • debian-12-xfce_socket-data-duplex: 165.57 :small_red_triangle_up: ( previous job: 81.49, degradation: 203.18%)
  • fedora-41-xfce_exec-data-simplex: 61.99 :small_red_triangle_up: ( previous job: 49.65, degradation: 124.85%)
  • fedora-41-xfce_exec-data-duplex: 65.16 :small_red_triangle_up: ( previous job: 49.08, degradation: 132.76%)
  • fedora-41-xfce_exec-data-duplex-root: 101.31 :small_red_triangle_up: ( previous job: 81.65, degradation: 124.08%)
  • fedora-41-xfce_socket-data-duplex: 138.12 :small_red_triangle_up: ( previous job: 78.62, degradation: 175.68%)
  • whonix-gateway-17_exec-data-simplex: 75.79 :small_red_triangle_up: ( previous job: 48.76, degradation: 155.42%)
  • whonix-gateway-17_exec-data-duplex: 74.65 :small_red_triangle_up: ( previous job: 48.55, degradation: 153.75%)
  • whonix-gateway-17_exec-data-duplex-root: 92.61 :small_red_triangle_up: ( previous job: 70.13, degradation: 132.07%)
  • whonix-gateway-17_socket-data-duplex: 158.12 :small_red_triangle_up: ( previous job: 82.74, degradation: 191.11%)
  • whonix-workstation-17_exec-data-simplex: 75.85 :small_red_triangle_up: ( previous job: 47.01, degradation: 161.33%)
  • whonix-workstation-17_exec-data-duplex: 71.56 :small_red_triangle_up: ( previous job: 49.48, degradation: 144.64%)
  • whonix-workstation-17_exec-data-duplex-root: 93.03 :small_red_triangle_up: ( previous job: 79.93, degradation: 116.39%)
  • whonix-workstation-17_socket-data-duplex: 151.07 :small_red_triangle_up: ( previous job: 81.71, degradation: 184.88%)
  • dom0_root_seq1m_q8t1_read 3:read_bandwidth_kb: 398092.00 :small_red_triangle_up: ( previous job: 486352.00, degradation: 81.85%)
  • dom0_root_seq1m_q8t1_write 3:write_bandwidth_kb: 144951.00 :small_red_triangle_up: ( previous job: 276742.00, degradation: 52.38%)
  • dom0_root_seq1m_q1t1_read 3:read_bandwidth_kb: 46095.00 :small_red_triangle_up: ( previous job: 423495.00, degradation: 10.88%)
  • dom0_root_seq1m_q1t1_write 3:write_bandwidth_kb: 74275.00 :small_red_triangle_up: ( previous job: 185030.00, degradation: 40.14%)
  • dom0_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 11197.00 :small_red_triangle_up: ( previous job: 100699.00, degradation: 11.12%)
  • dom0_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 752.00 :small_red_triangle_up: ( previous job: 3277.00, degradation: 22.95%)
  • dom0_varlibqubes_seq1m_q8t1_read 3:read_bandwidth_kb: 424181.00 :small_red_triangle_up: ( previous job: 475329.00, degradation: 89.24%)
  • dom0_varlibqubes_rnd4k_q32t1_write 3:write_bandwidth_kb: 5802.00 :small_red_triangle_up: ( previous job: 8767.00, degradation: 66.18%)
  • fedora-41-xfce_root_seq1m_q1t1_read 3:read_bandwidth_kb: 305262.00 :small_red_triangle_up: ( previous job: 343795.00, degradation: 88.79%)
  • fedora-41-xfce_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 903.00 :small_red_triangle_up: ( previous job: 1126.00, degradation: 80.20%)
  • fedora-41-xfce_private_rnd4k_q32t1_read 3:read_bandwidth_kb: 68830.00 :small_red_triangle_up: ( previous job: 87999.00, degradation: 78.22%)
  • fedora-41-xfce_private_rnd4k_q32t1_write 3:write_bandwidth_kb: 3360.00 :small_red_triangle_up: ( previous job: 3885.00, degradation: 86.49%)
  • fedora-41-xfce_volatile_seq1m_q8t1_read 3:read_bandwidth_kb: 274928.00 :small_red_triangle_up: ( previous job: 392725.00, degradation: 70.01%)
  • fedora-41-xfce_volatile_rnd4k_q32t1_read 3:read_bandwidth_kb: 50641.00 :small_red_triangle_up: ( previous job: 71108.00, degradation: 71.22%)
  • fedora-41-xfce_volatile_rnd4k_q32t1_write 3:write_bandwidth_kb: 3157.00 :small_red_triangle_up: ( previous job: 3959.00, degradation: 79.74%)
  • fedora-41-xfce_volatile_rnd4k_q1t1_write 3:write_bandwidth_kb: 963.00 :small_red_triangle_up: ( previous job: 2693.00, degradation: 35.76%)

Remaining performance tests:

40 tests
  • debian-12-xfce_exec: 6.45 🟢 ( previous job: 7.15, improvement: 90.19%)
  • debian-12-xfce_exec-root: 28.87 :small_red_triangle_up: ( previous job: 27.97, degradation: 103.24%)
  • debian-12-xfce_socket: 8.62 :small_red_triangle_up: ( previous job: 8.33, degradation: 103.53%)
  • debian-12-xfce_socket-root: 8.63 :small_red_triangle_up: ( previous job: 8.20, degradation: 105.16%)
  • fedora-41-xfce_exec: 9.18 :small_red_triangle_up: ( previous job: 9.13, degradation: 100.46%)
  • fedora-41-xfce_exec-root: 60.13 🟢 ( previous job: 61.17, improvement: 98.30%)
  • fedora-41-xfce_socket: 8.22 🟢 ( previous job: 8.66, improvement: 94.91%)
  • fedora-41-xfce_socket-root: 8.58 🟢 ( previous job: 8.61, improvement: 99.64%)
  • whonix-gateway-17_exec: 7.92 :small_red_triangle_up: ( previous job: 7.87, degradation: 100.66%)
  • whonix-gateway-17_exec-root: 41.59 :small_red_triangle_up: ( previous job: 38.36, degradation: 108.40%)
  • whonix-gateway-17_socket: 8.21 :small_red_triangle_up: ( previous job: 7.54, degradation: 108.81%)
  • whonix-gateway-17_socket-root: 7.14 🟢 ( previous job: 8.27, improvement: 86.35%)
  • whonix-workstation-17_exec: 7.42 🟢 ( previous job: 8.23, improvement: 90.11%)
  • whonix-workstation-17_exec-root: 53.80 :small_red_triangle_up: ( previous job: 52.56, degradation: 102.36%)
  • whonix-workstation-17_socket: 8.66 :small_red_triangle_up: ( previous job: 8.21, degradation: 105.50%)
  • whonix-workstation-17_socket-root: 8.30 :small_red_triangle_up: ( previous job: 8.20, degradation: 101.25%)
  • dom0_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 9388.00 :small_red_triangle_up: ( previous job: 10163.00, degradation: 92.37%)
  • dom0_root_rnd4k_q1t1_write 3:write_bandwidth_kb: 286.00 :green_circle: ( previous job: 282.00, improvement: 101.42%)
  • dom0_varlibqubes_seq1m_q8t1_write 3:write_bandwidth_kb: 115744.00 :green_circle: ( previous job: 95209.00, improvement: 121.57%)
  • dom0_varlibqubes_seq1m_q1t1_read 3:read_bandwidth_kb: 439102.00 :green_circle: ( previous job: 433474.00, improvement: 101.30%)
  • dom0_varlibqubes_seq1m_q1t1_write 3:write_bandwidth_kb: 161813.00 :small_red_triangle_up: ( previous job: 164133.00, degradation: 98.59%)
  • dom0_varlibqubes_rnd4k_q32t1_read 3:read_bandwidth_kb: 111470.00 :green_circle: ( previous job: 99808.00, improvement: 111.68%)
  • dom0_varlibqubes_rnd4k_q1t1_read 3:read_bandwidth_kb: 7684.00 :green_circle: ( previous job: 7053.00, improvement: 108.95%)
  • dom0_varlibqubes_rnd4k_q1t1_write 3:write_bandwidth_kb: 3871.00 :green_circle: ( previous job: 3868.00, improvement: 100.08%)
  • fedora-41-xfce_root_seq1m_q8t1_read 3:read_bandwidth_kb: 368050.00 :small_red_triangle_up: ( previous job: 396586.00, degradation: 92.80%)
  • fedora-41-xfce_root_seq1m_q8t1_write 3:write_bandwidth_kb: 240996.00 :green_circle: ( previous job: 99783.00, improvement: 241.52%)
  • fedora-41-xfce_root_seq1m_q1t1_write 3:write_bandwidth_kb: 118751.00 :green_circle: ( previous job: 44770.00, improvement: 265.25%)
  • fedora-41-xfce_root_rnd4k_q32t1_read 3:read_bandwidth_kb: 79061.00 :small_red_triangle_up: ( previous job: 86742.00, degradation: 91.15%)
  • fedora-41-xfce_root_rnd4k_q32t1_write 3:write_bandwidth_kb: 4227.00 :green_circle: ( previous job: 3785.00, improvement: 111.68%)
  • fedora-41-xfce_root_rnd4k_q1t1_read 3:read_bandwidth_kb: 8180.00 :small_red_triangle_up: ( previous job: 8623.00, degradation: 94.86%)
  • fedora-41-xfce_private_seq1m_q8t1_read 3:read_bandwidth_kb: 362829.00 :small_red_triangle_up: ( previous job: 401907.00, degradation: 90.28%)
  • fedora-41-xfce_private_seq1m_q8t1_write 3:write_bandwidth_kb: 249008.00 :green_circle: ( previous job: 116848.00, improvement: 213.10%)
  • fedora-41-xfce_private_seq1m_q1t1_read 3:read_bandwidth_kb: 338032.00 :small_red_triangle_up: ( previous job: 357875.00, degradation: 94.46%)
  • fedora-41-xfce_private_seq1m_q1t1_write 3:write_bandwidth_kb: 95260.00 :green_circle: ( previous job: 41375.00, improvement: 230.24%)
  • fedora-41-xfce_private_rnd4k_q1t1_read 3:read_bandwidth_kb: 8779.00 :green_circle: ( previous job: 8744.00, improvement: 100.40%)
  • fedora-41-xfce_private_rnd4k_q1t1_write 3:write_bandwidth_kb: 1805.00 :green_circle: ( previous job: 1613.00, improvement: 111.90%)
  • fedora-41-xfce_volatile_seq1m_q8t1_write 3:write_bandwidth_kb: 251155.00 :green_circle: ( previous job: 139933.00, improvement: 179.48%)
  • fedora-41-xfce_volatile_seq1m_q1t1_read 3:read_bandwidth_kb: 337488.00 :green_circle: ( previous job: 294875.00, improvement: 114.45%)
  • fedora-41-xfce_volatile_seq1m_q1t1_write 3:write_bandwidth_kb: 123456.00 :green_circle: ( previous job: 78093.00, improvement: 158.09%)
  • fedora-41-xfce_volatile_rnd4k_q1t1_read 3:read_bandwidth_kb: 7568.00 :small_red_triangle_up: ( previous job: 8408.00, degradation: 90.01%)

@ArrayBolt3

Copy link
Copy Markdown
Contributor Author

Self-review done, found and fixed some minor issues in qubes-manager and one issue that snuck by me in qubes-core-admin.

@codecov

codecov Bot commented Mar 10, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 97.87234% with 1 line in your changes missing coverage. Please review.

Project coverage is 68.85%. Comparing base (918b8d2) to head (d27ed53).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
qubesmanager/settings.py 97.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #407      +/-   ##
==========================================
+ Coverage   68.55%   68.85%   +0.30%     
==========================================
  Files          17       17              
  Lines        3762     3808      +46     
==========================================
+ Hits         2579     2622      +43     
- Misses       1183     1186       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ArrayBolt3

Copy link
Copy Markdown
Contributor Author

The two lines that are failing to be covered by regression tests are lines I don't think the tests can cover with the current test design - they both would normally be triggered when the settings window was first opened. I can't patch the property_get_default function used by initialize_widget_for_property early enough to make it return something other than default during window creation though, so only the default code paths are taken for those spots.

@marmarek

Copy link
Copy Markdown
Member

But you can have a VM with non-default boot mode, no? Just set the bootmode property in the mockup (probably instead of setting boot-mode.active feature, which isn't relevant to the frontend).

@ArrayBolt3

Copy link
Copy Markdown
Contributor Author

The value of the bootmode property will be ignored when using property_get_default though, because we're getting the property's default value so that we have something to fill in for the default (name) selection in the combo box. In actual use, that default value would come from the boot-mode.active feature if possible, but that doesn't work in the tests for obvious reasons.

@marmarek

Copy link
Copy Markdown
Member

I mean the other not covered line. The one about property_get_default is less important.

@ArrayBolt3

Copy link
Copy Markdown
Contributor Author

ah, I see what you mean now (I had it in my head that both were in a similar situation but I see now that's not the case). I'll add another mockup and another testcase and see if I can get that one too.

Boot modes provide a way for VMs to advertise that they can have their
behavior changed by booting them with a predefined combination of
additional kernel parameters set. This allows qubes to offer features
like a secure system maintenance mode in a way that works seemlessly
with Qubes OS.

This commit adds boot mode support to Qubes Manager, allowing the user
to view and select boot modes in the advanced tab of the settings
dialog for each qube.
@ArrayBolt3

Copy link
Copy Markdown
Contributor Author

@marmarek I believe the addition to the tests you wanted is now added. coverage html shows the if self.vm.bootmode != "default": bit on settings.py line 957 is now covered

Comment thread qubesmanager/settings.py Outdated

@marmarek marmarek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; but I'd like also @marmarta confirmation the interface is ok

@marmarek marmarek merged commit 57f1cf8 into QubesOS:main Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants