diff --git a/qubes/tests/vm/init.py b/qubes/tests/vm/init.py
index 83dd8d55..436279a4 100644
--- a/qubes/tests/vm/init.py
+++ b/qubes/tests/vm/init.py
@@ -61,7 +61,6 @@ class TC_10_BaseVM(qubes.tests.QubesTestCase):
-
aqq
@@ -92,7 +91,6 @@ class TC_10_BaseVM(qubes.tests.QubesTestCase):
self.assertEqual(vm.defaultprop, 'defaultvalue')
self.assertEqual(vm.tags, {'testtag': 'tagvalue'})
self.assertEqual(vm.features, {
- 'testfeature_none': None,
'testfeature_empty': '',
'testfeature_aqq': 'aqq',
})
diff --git a/qubes/vm/__init__.py b/qubes/vm/__init__.py
index c72474cc..097d1c09 100644
--- a/qubes/vm/__init__.py
+++ b/qubes/vm/__init__.py
@@ -79,7 +79,7 @@ class Features(dict):
self.vm.fire_event('domain-feature-delete', key)
def __setitem__(self, key, value):
- if isinstance(value, bool):
+ if value is None or isinstance(value, bool):
value = '1' if value else ''
else:
value = str(value)
@@ -185,7 +185,7 @@ class BaseVM(qubes.PropertyHolder):
if self.xml is not None:
# features
- for node in xml.xpath('./features/service'):
+ for node in xml.xpath('./features/feature'):
self.features[node.get('name')] = node.text
# devices (pci, usb, ...)
@@ -231,7 +231,7 @@ class BaseVM(qubes.PropertyHolder):
features = lxml.etree.Element('features')
for feature in self.features:
- node = lxml.etree.Element('service', name=feature)
+ node = lxml.etree.Element('feature', name=feature)
node.text = self.features[feature]
features.append(node)
element.append(features)
diff --git a/relaxng/qubes.rng b/relaxng/qubes.rng
index c40b4534..667e263b 100644
--- a/relaxng/qubes.rng
+++ b/relaxng/qubes.rng
@@ -175,7 +175,7 @@ the parser will complain about missing combine= attribute on the second .
- [a-z0-9_-]+
+ [a-z0-9_-]*