diff --git a/qubes/__init__.py b/qubes/__init__.py index bad38c68..e741b035 100644 --- a/qubes/__init__.py +++ b/qubes/__init__.py @@ -841,7 +841,7 @@ class PropertyHolder(qubes.events.Emitter): self.fire_event('property-loaded') - def save_properties(self, with_defaults=False): + def xml_properties(self, with_defaults=False): '''Iterator that yields XML nodes representing set properties. :param bool with_defaults: If :py:obj:`True`, then it also includes properties which were not set explicite, but have default values filled. @@ -1144,8 +1144,8 @@ class Qubes(PropertyHolder): def __xml__(self): element = lxml.etree.Element('qubes') - element.append(self.save_labels()) - element.append(self.save_properties()) + element.append(self.xml_labels()) + element.append(self.xml_properties()) domains = lxml.etree.Element('domains') for vm in self.domains: @@ -1167,7 +1167,7 @@ class Qubes(PropertyHolder): os.chown(self._store, -1, grp.getgrnam('qubes').gr_gid) - def save_labels(self): + def xml_labels(self): '''Serialise labels :rtype: lxml.etree._Element diff --git a/qubes/tests/init.py b/qubes/tests/init.py index dc4131b3..d16c02cd 100644 --- a/qubes/tests/init.py +++ b/qubes/tests/init.py @@ -190,8 +190,8 @@ class TC_20_PropertyHolder(qubes.tests.QubesTestCase): def test_001_save_properties(self): self.holder.load_properties() - elements = self.holder.save_properties() - elements_with_defaults = self.holder.save_properties(with_defaults=True) + elements = self.holder.xml_properties() + elements_with_defaults = self.holder.xml_properties(with_defaults=True) self.assertEqual(len(elements), 2) self.assertEqual(len(elements_with_defaults), 3) diff --git a/qubes/vm/__init__.py b/qubes/vm/__init__.py index ab31e78a..cedb4384 100644 --- a/qubes/vm/__init__.py +++ b/qubes/vm/__init__.py @@ -256,7 +256,7 @@ class BaseVM(qubes.PropertyHolder): element.set('id', 'domain-' + str(self.qid)) element.set('class', self.__class__.__name__) - element.append(self.save_properties()) + element.append(self.xml_properties()) services = lxml.etree.Element('services') for service in self.services: @@ -303,7 +303,7 @@ class BaseVM(qubes.PropertyHolder): # @staticmethod - def xml_net_dev(ip, mac, backend): + def lvxml_net_dev(ip, mac, backend): '''Return ```` node for libvirt xml. This was previously _format_net_dev @@ -323,7 +323,7 @@ class BaseVM(qubes.PropertyHolder): @staticmethod - def xml_pci_dev(address): + def lvxml_pci_dev(address): '''Return ```` node for libvirt xml. This was previously _format_pci_dev @@ -365,7 +365,7 @@ class BaseVM(qubes.PropertyHolder): args['uuidnode'] = '{!r}'.format(self.uuid) \ if hasattr(self, 'uuid') else '' args['vmdir'] = self.dir_path - args['pcidevs'] = ''.join(lxml.etree.tostring(self.xml_pci_dev(dev)) + args['pcidevs'] = ''.join(lxml.etree.tostring(self.lvxml_pci_dev(dev)) for dev in self.devices['pci']) args['maxmem'] = str(self.maxmem) args['vcpus'] = str(self.vcpus) @@ -382,7 +382,7 @@ class BaseVM(qubes.PropertyHolder): args['dns1'] = self.netvm.gateway args['dns2'] = self.secondary_dns args['netmask'] = self.netmask - args['netdev'] = lxml.etree.tostring(self.xml_net_dev(self.ip, self.mac, self.netvm)) + args['netdev'] = lxml.etree.tostring(self.lvxml_net_dev(self.ip, self.mac, self.netvm)) args['disable_network1'] = ''; args['disable_network2'] = ''; else: diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 25d50cea..f28e9a95 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -1058,7 +1058,7 @@ class QubesVM(qubes.vm.BaseVM): netvm.start() self.libvirt_domain.attachDevice(lxml.etree.ElementTree( - self.xml_net_dev(self.ip, self.mac, self.netvm)).tostring()) + self.lvxml_net_dev(self.ip, self.mac, self.netvm)).tostring()) def detach_network(self): @@ -1072,7 +1072,7 @@ class QubesVM(qubes.vm.BaseVM): self.libvirt_domain.detachDevice(lxml.etree.ElementTree( - self.xml_net_dev(self.ip, self.mac, self.netvm)).tostring()) + self.lvxml_net_dev(self.ip, self.mac, self.netvm)).tostring()) #