core: store dom0 info in qubes.xml

At least to have there info about its backup.
This commit is contained in:
Marek Marczykowski-Górecki 2013-11-24 23:50:39 +01:00
parent a64f7c12ad
commit dc6fd3c8f3
2 changed files with 14 additions and 7 deletions

View File

@ -26,6 +26,10 @@ from qubes.qubes import defaults
from qubes.qubes import QubesException,dry_run
class QubesDom0NetVm(QubesNetVm):
# In which order load this VM type from qubes.xml
load_order = 10
def __init__(self, **kwargs):
super(QubesDom0NetVm, self).__init__(qid=0, name="dom0", netid=0,
dir_path=None,
@ -35,6 +39,10 @@ class QubesDom0NetVm(QubesNetVm):
**kwargs)
self.xid = 0
@property
def type(self):
return "Dom0NetVM"
def is_running(self):
return True
@ -83,9 +91,6 @@ class QubesDom0NetVm(QubesNetVm):
domains = xc.domain_getinfo(0, 1)
return domains[0]
def create_xml_element(self):
return None
def verify_files(self):
return True

View File

@ -609,10 +609,6 @@ class QubesVmCollection(dict):
def load(self):
self.clear()
dom0vm = QubesDom0NetVm (collection=self)
self[dom0vm.qid] = dom0vm
self.default_netvm_qid = 0
try:
tree = lxml.etree.parse(self.qubes_store_file)
except (EnvironmentError,
@ -661,6 +657,12 @@ class QubesVmCollection(dict):
# using 123/udp port)
if self.clockvm_qid is not None:
self[self.clockvm_qid].services['ntpd'] = False
# Add dom0 if wasn't present in qubes.xml
if not 0 in self.keys():
dom0vm = QubesDom0NetVm (collection=self)
self[dom0vm.qid] = dom0vm
return True
def pop(self, qid):