Merge remote-tracking branch 'origin/pr/362'

* origin/pr/362:
  Fixed property-reset event not firing for default_dispvm global property
This commit is contained in:
Marek Marczykowski-Górecki 2020-08-06 05:41:30 +02:00
commit 512ff8e8b8
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1546,3 +1546,15 @@ class Qubes(qubes.PropertyHolder):
# netvm to it's default value
vm.fire_event('property-reset:netvm',
name='netvm', oldvalue=oldvalue)
@qubes.events.handler('property-set:default_dispvm')
def on_property_set_default_dispvm(self, event, name, newvalue,
oldvalue=None):
# pylint: disable=unused-argument
for vm in self.domains:
if hasattr(vm, 'default_dispvm') and \
vm.property_is_default('default_dispvm'):
# fire property-reset:default_dispvm as it is responsible for
# resetting dispvm to it's default value
vm.fire_event('property-reset:default_dispvm',
name='default_dispvm', oldvalue=oldvalue)