From 751e0b380a25fecf3a2e3cedbbdd1ba034e4c72c Mon Sep 17 00:00:00 2001 From: Joanna Rutkowska Date: Sun, 28 Nov 2010 16:30:26 +0100 Subject: [PATCH 1/3] qvm-backup: support --exclude option --- dom0/qvm-tools/qvm-backup | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dom0/qvm-tools/qvm-backup b/dom0/qvm-tools/qvm-backup index 664b6050..8dbcdc4f 100755 --- a/dom0/qvm-tools/qvm-backup +++ b/dom0/qvm-tools/qvm-backup @@ -56,6 +56,9 @@ def main(): usage = "usage: %prog [options] " parser = OptionParser (usage) + parser.add_option ("-x", "--exclude", action="append", dest="exclude_list", + help="Exclude the specified VM from backup (might be repeated)") + (options, args) = parser.parse_args () if (len (args) != 1): @@ -73,7 +76,13 @@ def main(): qvm_collection.lock_db_for_reading() qvm_collection.load() - vms_list = [vm for vm in qvm_collection.values()] + + if options is not None and options.exclude_list is not None: + print "Excluding the following VMs:", options.exclude_list + vms_list = [vm for vm in qvm_collection.values() if vm.name not in options.exclude_list] + else: + vms_list = [vm for vm in qvm_collection.values()] + no_vms = len (vms_list) files_to_backup = file_to_backup (qubes_store_filename) From a5c4a1626e1886c255881dc33914f7616b35ef43 Mon Sep 17 00:00:00 2001 From: Joanna Rutkowska Date: Sat, 18 Dec 2010 07:25:47 +0100 Subject: [PATCH 2/3] qvm-backup-restore: support for --skip-conflicting option --- dom0/qvm-tools/qvm-backup-restore | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dom0/qvm-tools/qvm-backup-restore b/dom0/qvm-tools/qvm-backup-restore index 6ddaf82c..43e15379 100755 --- a/dom0/qvm-tools/qvm-backup-restore +++ b/dom0/qvm-tools/qvm-backup-restore @@ -112,7 +112,10 @@ def main(): parser.add_option ("--ignore-missing", action="store_true", dest="ignore_missing", default=False, help="Ignore missing templates or netvms, restore VMs anyway") - + + parser.add_option ("--skip-conflicting", action="store_true", dest="skip_conflicting", default=False, + help="Do not restore VMs that are already present on the host") + (options, args) = parser.parse_args () if (len (args) != 1): @@ -186,7 +189,7 @@ def main(): if host_collection.get_vm_by_name (vm.name) is not None: s += " <-- A VM with the same name already exists on the host!" there_are_conflicting_vms = True - good_to_go = False + good_to_go = False # Do not overwrite VMs on the host! if vm.is_appvm(): templatevm_name = vm.template_vm.name @@ -224,9 +227,11 @@ def main(): if there_are_conflicting_vms: print "*** There VMs with conflicting names on the host! ***" + if options.skip_conflicting: + print "Those VMs will not be restored, the host VMs will not be overwritten!" + else: print "Remove VMs with conflicting names from the host before proceeding." - print "You can use 'qvm-remove ' command for this." - print "Be careful! Think twice before typing qvm-remove!!!" + print "... or use --skip-conflicting to restore only those VMs that do not exist on the host." exit (1) print "The above VMs will be copied and added to your system." @@ -241,7 +246,7 @@ def main(): elif options.skip_broken: print "... VMs that depend on it will not be restored (--skip-broken used)" elif options.ignore_missing: - print "... VMs that depend on it be restored anyway (--ignore-missing used)" + print "... VMs that depend on it will be restored anyway (--ignore-missing used)" else: print "INTERNAL ERROR?!" exit (1) From e659710d62ceb21ef80143441211703dc55bdad5 Mon Sep 17 00:00:00 2001 From: Joanna Rutkowska Date: Wed, 16 Mar 2011 15:57:42 +0100 Subject: [PATCH 3/3] version 1.4.1 --- version_dom0 | 2 +- version_vm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/version_dom0 b/version_dom0 index 25b22e06..347f5833 100644 --- a/version_dom0 +++ b/version_dom0 @@ -1 +1 @@ -1.3.16 +1.4.1 diff --git a/version_vm b/version_vm index 7962dcfd..347f5833 100644 --- a/version_vm +++ b/version_vm @@ -1 +1 @@ -1.3.13 +1.4.1