From 016837a19c95621131e290be4852b4e5b9c75439 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 24 Apr 2012 12:34:31 +0200 Subject: [PATCH] dom0/core: fix 'drive' saving logic There is no longer need to override get_xml_attrs. Also include 'drive' in properties retrieved from qubes.xml. --- dom0/qvm-core/qubes.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index b34a5eb2..4124f7cf 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -2364,11 +2364,6 @@ class QubesHVm(QubesVm): xc.domain_unpause(self.stubdom_xid) super(QubesHVm, self).unpause() - def get_xml_attrs(self): - attrs = super(QubesHVm, self).get_xml_attrs() - attrs["drive"] = str(self.drive) - return attrs - class QubesVmCollection(dict): """ A collection of Qubes VMs indexed by Qubes id (qid) @@ -2731,7 +2726,7 @@ class QubesVmCollection(dict): "installed_by_rpm", "internal", "uses_default_netvm", "label", "memory", "vcpus", "pcidevs", "maxmem", "kernel", "uses_default_kernel", "kernelopts", "uses_default_kernelopts", - "mac", "services", "include_in_backups", "debug" ) + "mac", "services", "include_in_backups", "debug", "drive" ) for attribute in common_attr_list: kwargs[attribute] = element.get(attribute) @@ -2793,6 +2788,9 @@ class QubesVmCollection(dict): if "debug" in kwargs: kwargs["debug"] = True if kwargs["debug"] == "True" else False + if "drive" in kwargs and kwargs["drive"] == "None": + kwargs["drive"] = None + return kwargs def set_netvm_dependency(self, element):