From c0e3281d04b1685986a17608a53f636f0258aab1 Mon Sep 17 00:00:00 2001 From: Wojtek Porczyk Date: Thu, 8 Jan 2015 19:44:14 +0100 Subject: [PATCH] qubes: fix changing domain name Changing name of running VM is wrong. Acknowledgement: This commit is a result of core3 review by Marek. --- qubes/vm/qubesvm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index be2d9765..e69b12d1 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -509,6 +509,9 @@ class QubesVM(qubes.vm.BaseVM): @qubes.events.handler('property-set:name') def on_property_set_name(self, event, name, new_name, old_name=None): + # TODO not self.is_stopped() would be more appropriate + if self.is_running(): + raise QubesException('Cannot change name of running domain') if self.libvirt_domain: self.libvirt_domain.undefine() self._libvirt_domain = None