Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude VMs with skip-update boolean feature #170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/tools/qubes-vm-update.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Targeting is used to choose the VMs that will be checked for available updates,

Additionally, not all VMs in the system can be updated directly (such as AppVMs), and to update them, you must use one of the "propagation" options. This means, after updating the template, restarting the VM and applying the installed updates to it. Using at least the `--apply-to-sys` flag is recommended, which restarts all service VMs. Keep in mind that during this process, unsaved data may be lost.

VMs with `skip-update` feature set to True will be excluded from update, unless directly targeted with `--targets` option.

RETURN CODES
============

Expand Down
6 changes: 6 additions & 0 deletions vmupdate/vmupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ def preselect_targets(args, app) -> Set[qubesadmin.vm.QubesVM]:
print("Skipping dom0. To update AdminVM use `qubes-dom0-update`")
targets = {vm for vm in targets
if vm.name != 'dom0' and vm.name not in to_skip}

# exclude vms with `skip-update` feature, but allow --targets to override it
if not args.targets:
targets = {vm for vm in targets
if not bool(vm.features.get('skip-update', False))}

return targets


Expand Down