From 5c2e676fa1eec98d8139621c11d115421eae03b6 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 11 Mar 2011 02:00:42 +0100 Subject: [PATCH] Set netvm reference only after NetVMs/ProxyVMs load - ProxyVM --- dom0/qvm-core/qubes.py | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index e8214927..be785d2e 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -1783,7 +1783,7 @@ class QubesVmCollection(dict): attr_list = ("qid", "name", "dir_path", "conf_file", "appvms_conf_file", "private_img", "root_img", "installed_by_rpm", "updateable", - "uses_default_netvm", "netvm_qid") + "uses_default_netvm") for attribute in attr_list: kwargs[attribute] = element.get(attribute) @@ -1793,26 +1793,6 @@ class QubesVmCollection(dict): if kwargs["updateable"] is not None: kwargs["updateable"] = True if kwargs["updateable"] == "True" else False - if "uses_default_netvm" not in kwargs: - kwargs["uses_default_netvm"] = True - else: - kwargs["uses_default_netvm"] = True if kwargs["uses_default_netvm"] == "True" else False - if kwargs["uses_default_netvm"] is True: - netvm_vm = self.get_default_netvm_vm() - kwargs.pop("netvm_qid") - else: - if kwargs["netvm_qid"] == "none" or kwargs["netvm_qid"] is None: - netvm_vm = None - kwargs.pop("netvm_qid") - else: - netvm_qid = int(kwargs.pop("netvm_qid")) - if netvm_qid not in self: - netvm_vm = None - else: - netvm_vm = self[netvm_qid] - - kwargs["netvm_vm"] = netvm_vm - vm = QubesTemplateVm(**kwargs) self[vm.qid] = vm @@ -1878,18 +1858,6 @@ class QubesVmCollection(dict): kwargs["template_vm"] = template_vm kwargs["netid"] = int(kwargs["netid"]) - if kwargs["netvm_qid"] == "none" or kwargs["netvm_qid"] is None: - netvm_vm = None - kwargs.pop("netvm_qid") - else: - netvm_qid = int(kwargs.pop("netvm_qid")) - if netvm_qid not in self: - netvm_vm = None - else: - netvm_vm = self[netvm_qid] - - kwargs["netvm_vm"] = netvm_vm - vm = QubesProxyVm(**kwargs) self[vm.qid] = vm