From 913cc27023a5bfb7f0d4cb7abdb396b98418c828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 10 Apr 2015 18:30:15 +0200 Subject: [PATCH] core: fix QubesVm.clone_attrs - really copy dicts Otherwise it would point at the same object and for example changing vm.services[] in one VM will change that also for another. That link will be severed after reloading the VMs from qubes.xml, but at least in case of DispVM startup its too late - vm.service['qubes-dvm'] is set for the DispVM template even during normal startup, not savefile preparation. --- core-modules/000QubesVm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index 04ecec16..5d2570b9 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -1210,7 +1210,10 @@ class QubesVm(object): self._do_not_reset_firewall = True for prop in self.get_clone_attrs(): try: - setattr(self, prop, getattr(src_vm, prop)) + val = getattr(src_vm, prop) + if isinstance(val, dict): + val = val.copy() + setattr(self, prop, val) except Exception as e: if fail_on_error: self._do_not_reset_firewall = False