From 156778fcd7cd2fa30cc6f5dd5707f1b42f96b8bd Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 1 Apr 2011 02:06:22 +0200 Subject: [PATCH] Set template field before check its correctness. Backup from Aplha3 with updateable VMs contains case, when updateable VM have template. So set this template (to make qvm-backup-restore working), but give error message. Also fix typo. --- dom0/qvm-core/qubes.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 9b258d4a..c17b87c5 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -237,10 +237,11 @@ class QubesVm(object): self.memory = memory + self.template_vm = template_vm if template_vm is not None: if updateable: print "ERROR: Template based VM cannot be updateable!" - return false + return False if not template_vm.is_template(): print "ERROR: template_qid={0} doesn't point to a valid TemplateVM".\ format(template_vm.qid) @@ -250,8 +251,6 @@ class QubesVm(object): else: assert self.root_img is not None, "Missing root_img for standalone VM!" - self.template_vm = template_vm - # By default allow use all VCPUs if vcpus is None: qubes_host = QubesHost()