From 3f33a7bc2ce0d45b3e5acc6b2a7b2e612caf3a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 14 Aug 2017 02:30:52 +0200 Subject: [PATCH] fix and enable ServicesExtension This extension is responsible for communicating service.* features to VMs - in other words, qvm-service framework Fixes QubesOS/qubes-issues#3019 --- qubes/ext/services.py | 8 +++++--- setup.py | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qubes/ext/services.py b/qubes/ext/services.py index 85f29dde..23be77c0 100644 --- a/qubes/ext/services.py +++ b/qubes/ext/services.py @@ -28,8 +28,9 @@ class ServicesExtension(qubes.ext.Extension): ''' # pylint: disable=no-self-use @qubes.ext.handler('domain-qdb-create') - def on_domain_qdb_create(self, vm): + def on_domain_qdb_create(self, vm, event): '''Actually export features''' + # pylint: disable=unused-argument for feature, value in vm.features.items(): if not feature.startswith('service.'): continue @@ -39,7 +40,7 @@ class ServicesExtension(qubes.ext.Extension): str(int(bool(value)))) @qubes.ext.handler('domain-feature-set') - def on_domain_feature_set(self, vm, feature, value, oldvalue=None): + def on_domain_feature_set(self, vm, event, feature, value, oldvalue=None): '''Update /qubes-service/ QubesDB tree in runtime''' # pylint: disable=unused-argument if not vm.is_running(): @@ -52,8 +53,9 @@ class ServicesExtension(qubes.ext.Extension): str(int(bool(value)))) @qubes.ext.handler('domain-feature-delete') - def on_domain_feature_delete(self, vm, feature): + def on_domain_feature_delete(self, vm, event, feature): '''Update /qubes-service/ QubesDB tree in runtime''' + # pylint: disable=unused-argument if not vm.is_running(): return if not feature.startswith('service.'): diff --git a/setup.py b/setup.py index 0f1f40e1..6f4b0ca5 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,7 @@ if __name__ == '__main__': 'qubes.ext.r3compatibility = qubes.ext.r3compatibility:R3Compatibility', 'qubes.ext.pci = qubes.ext.pci:PCIDeviceExtension', 'qubes.ext.block = qubes.ext.block:BlockDeviceExtension', + 'qubes.ext.services = qubes.ext.services:ServicesExtension', ], 'qubes.devices': [ 'pci = qubes.ext.pci:PCIDevice',