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.
This commit is contained in:
Marek Marczykowski 2012-04-24 12:34:31 +02:00
parent 2e7eb69c1a
commit 016837a19c

View File

@ -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):