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
This commit is contained in:
parent
a32bb4ecb2
commit
3f33a7bc2c
@ -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.'):
|
||||
|
1
setup.py
1
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',
|
||||
|
Loading…
Reference in New Issue
Block a user