From e8f21929ad223a69da5ca1cb84b9f6de08deb27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 3 Apr 2016 03:13:27 +0200 Subject: [PATCH] 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. --- qubes/backup.py | 12 +----------- qubes/vm/qubesvm.py | 4 ++-- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/qubes/backup.py b/qubes/backup.py index 3c7d2663..2cbe6cb4 100644 --- a/qubes/backup.py +++ b/qubes/backup.py @@ -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] diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 52e44c43..9fd3769d 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -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.')