From 9393b5f931babdc069710f02c031918baa72006b Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Wed, 22 May 2013 05:44:35 +0200 Subject: [PATCH] Fix domain rename libvirt_domain object needs to be recreated, so force it. Also fix config path setting (missing extension) - create_config_file uses it as custom config indicator (if such detected, VM settings - especially name, would not be updated). --- core-modules/000QubesVm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index b5eae453..773719f1 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -548,6 +548,7 @@ class QubesVm(object): self.pre_rename(name) self.libvirt_domain.undefine() + self._libvirt_domain = None new_conf = os.path.join(self.dir_path, name + '.conf') if os.path.exists(self.conf_file): @@ -652,6 +653,8 @@ class QubesVm(object): def _update_libvirt_domain(self): domain_config = self.create_config_file() + if self._libvirt_domain: + self._libvirt_domain.undefine() self._libvirt_domain = vmm.libvirt_conn.defineXML(domain_config) self.uuid = uuid.UUID(bytes=self._libvirt_domain.UUID())