From 062c3afcf570f0bbecfdca047e18a49ee198dbe5 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Wed, 22 May 2013 05:43:26 +0200 Subject: [PATCH] Remove unused 'source_template' parameter from some QubesVm internal functions --- core-modules/000QubesVm.py | 13 ++++--------- core-modules/003QubesTemplateVm.py | 3 +-- core-modules/01QubesDisposableVm.py | 11 +++++++++-- core-modules/01QubesHVm.py | 4 ++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index ebeb096b..b5eae453 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -1037,8 +1037,7 @@ class QubesVm(object): slot=dev_match.group(2), fun=dev_match.group(3)) - # FIXME: source_template unused - def get_rootdev(self, source_template=None): + def get_rootdev(self): if self.template: return self._format_disk_dev( "{dir}/root.img:{dir}/root-cow.img".format( @@ -1049,8 +1048,7 @@ class QubesVm(object): "{dir}/root.img".format(dir=self.dir_path), None, "xvda", True) - # FIXME: source_template unused - def get_config_params(self, source_template=None): + def get_config_params(self): args = {} args['name'] = self.name if hasattr(self, 'kernels_dir'): @@ -1113,8 +1111,7 @@ class QubesVm(object): def uses_custom_config(self): return self.conf_file != self.absolute_path(self.name + ".conf", None) - # FIXME: source_template unused - def create_config_file(self, file_path = None, source_template = None, prepare_dvm = False): + def create_config_file(self, file_path = None, prepare_dvm = False): if file_path is None: file_path = self.conf_file if self.uses_custom_config: @@ -1122,14 +1119,12 @@ class QubesVm(object): domain_config = conf_appvm.read() conf_appvm.close() return domain_config - if source_template is None: - source_template = self.template f_conf_template = open(self.config_file_template, 'r') conf_template = f_conf_template.read() f_conf_template.close() - template_params = self.get_config_params(source_template) + template_params = self.get_config_params() if prepare_dvm: template_params['name'] = '%NAME%' template_params['privatedev'] = '' diff --git a/core-modules/003QubesTemplateVm.py b/core-modules/003QubesTemplateVm.py index 5d2ca0fa..3ede7fc6 100644 --- a/core-modules/003QubesTemplateVm.py +++ b/core-modules/003QubesTemplateVm.py @@ -76,8 +76,7 @@ class QubesTemplateVm(QubesVm): def get_firewall_defaults(self): return { "rules": list(), "allow": False, "allowDns": False, "allowIcmp": False, "allowYumProxy": True } - # FIXME: source_template unused - def get_rootdev(self, source_template=None): + def get_rootdev(self): return self._format_disk_dev( "{dir}/root.img:{dir}/root-cow.img".format( dir=self.dir_path), diff --git a/core-modules/01QubesDisposableVm.py b/core-modules/01QubesDisposableVm.py index 7bb2dec0..b51e9a97 100644 --- a/core-modules/01QubesDisposableVm.py +++ b/core-modules/01QubesDisposableVm.py @@ -107,8 +107,15 @@ class QubesDisposableVm(QubesVm): def verify_files(self): return True - # FIXME: source_template unused - def get_config_params(self, source_template=None): + def create_xenstore_entries(self, xid): + super(QubesDisposableVm, self).create_xenstore_entries(xid) + + domain_path = vmm.xs.get_domain_path(xid) + + vmm.xs.write('', "{0}/qubes-restore-complete".format(domain_path), + 'True') + + def get_config_params(self): attrs = super(QubesDisposableVm, self).get_config_params() attrs['privatedev'] = '' return attrs diff --git a/core-modules/01QubesHVm.py b/core-modules/01QubesHVm.py index 837d481a..3a75f3e9 100644 --- a/core-modules/01QubesHVm.py +++ b/core-modules/01QubesHVm.py @@ -280,9 +280,9 @@ class QubesHVm(QubesVm): else: return "'script:file:{root_img},xvda,w',".format(root_img=self.root_img) - def get_config_params(self, source_template=None): + def get_config_params(self): - params = super(QubesHVm, self).get_config_params(source_template=source_template) + params = super(QubesHVm, self).get_config_params() params['volatiledev'] = '' if self.drive: