backup: by default include all the VMs with vm.include_in_backups

If there is a need for more robust default, it should be handled at that
property.
This commit is contained in:
Marek Marczykowski-Górecki 2016-04-03 03:13:27 +02:00 committed by Wojtek Porczyk
parent a3051b956b
commit e8f21929ad
2 changed files with 3 additions and 13 deletions

View File

@ -308,18 +308,8 @@ class Backup(object):
exclude_list = []
if vms_list is None:
all_vms = [vm for vm in app.domains]
selected_vms = [vm for vm in all_vms if vm.include_in_backups]
appvms_to_backup = [vm for vm in selected_vms if
vm.is_appvm() and not vm.internal]
template_vms_worth_backingup = [vm for vm in selected_vms if (
vm.is_template() and vm.include_in_backups)]
dom0 = [app.domains[0]]
vms_list = [vm for vm in app.domains if vm.include_in_backups]
vms_list = appvms_to_backup + \
template_vms_worth_backingup + dom0
self.vms_for_backup = vms_list
# Apply exclude list
self.vms_for_backup = [vm for vm in vms_list
if vm.name not in exclude_list]

View File

@ -262,8 +262,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
doc='''Setting this to `True` means that VM should be autostarted on
dom0 boot.''')
# XXX I don't understand backups
include_in_backups = qubes.property('include_in_backups', default=True,
include_in_backups = qubes.property('include_in_backups',
default=(lambda self: not self.internal),
type=bool, setter=qubes.property.bool,
doc='If this domain is to be included in default backup.')