Skip to content

Cleanup qvm_shutdown#448

Open
hippalectryon-0 wants to merge 3 commits intoQubesOS:mainfrom
hippalectryon-0:qvm_shutdown_cleanup_qubesmain
Open

Cleanup qvm_shutdown#448
hippalectryon-0 wants to merge 3 commits intoQubesOS:mainfrom
hippalectryon-0:qvm_shutdown_cleanup_qubesmain

Conversation

@hippalectryon-0
Copy link

@hippalectryon-0 hippalectryon-0 commented Mar 12, 2026

Mostly cleanup, with subtle inner API call changes that shouldn't affect users

Major changes

7d730eb harmonize behavior when has/hasnot_event

When have_events is False, after reaching timeout, the previous code calls Kill on the filtered current_vms = failed_domains(current_vms)current_vms = failed_domains(current_vms), whereas if it is True it calls Kill on all this_round_domains.

The commit harmonises this behavior to always filter.
This slightly changes the API calls, as seen in the modified utests.

a37814a cleanup dead code around args.wait

The current code does

  for vm in this_round_domains:
      try:
          vm.shutdown(force=force)
      except:
          if not args.wait:
              vm.log.error(...)  # THIS EXITS
          else:
              remaining_domains.add(vm)

From this point onward, if not args.wait, either we exited via error, or remaining_domains is empty (and then we return immediately after).
This makes most following code depending on args.wait obsolete.

Minor changes

7d730eb use a single asyncio interface for both cases where we do and don't have events

c08d6eb add utests

Note: this particular commit is mostly GenAI. Tests were reviewed manually.

@hippalectryon-0 hippalectryon-0 force-pushed the qvm_shutdown_cleanup_qubesmain branch from c08d6eb to e59cad6 Compare March 12, 2026 08:36
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.48%. Comparing base (c6b516d) to head (e59cad6).

Files with missing lines Patch % Lines
qubesadmin/tools/qvm_shutdown.py 93.75% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #448      +/-   ##
==========================================
+ Coverage   76.24%   76.48%   +0.23%     
==========================================
  Files          53       53              
  Lines        9325     9317       -8     
==========================================
+ Hits         7110     7126      +16     
+ Misses       2215     2191      -24     

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant