From 4d128dd0209e03460b6f5785b50ee0f19146e90b Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 23 Dec 2011 17:08:14 +0100 Subject: [PATCH] dom0: fix removing "special" VM (eg ClockVM) Unset collection pointer to some special VMs, when it is removed: ClockVM, default NetVM, default TemplateVM, UpdateVM --- dom0/qvm-core/qubes.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 10d54133..2c921f61 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -2530,6 +2530,20 @@ class QubesVmCollection(dict): self[self.clockvm_qid].services['ntpd'] = True return True + def pop(self, qid): + if self.default_netvm_qid == qid: + self.default_netvm_qid = None + if self.default_fw_netvm_qid == qid: + self.default_fw_netvm_qid = None + if self.clockvm_qid == qid: + self.clockvm_qid = None + if self.updatevm_qid == qid: + self.updatevm_qid = None + if self.default_template_qid == qid: + self.default_template_qid = None + + return super(QubesVmCollection, self).pop(qid) + class QubesDaemonPidfile(object): def __init__(self, name): self.name = name