Skip to content

Commit

Permalink
Avoid resetting clocksync service of just enabled clockvm
Browse files Browse the repository at this point in the history
When setting global clockvm property, 'clocksync' service is
automatically added to the new value and then removed from the old one.
But if the new value is the same as the old one, the service gets
removed from the just set new value.
Check for this case explicitly.

Fixes QubesOS/qubes-issues#4939
  • Loading branch information
marmarek committed Nov 30, 2019
1 parent 13f35da commit 5d77cf2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qubes/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,8 @@ def on_property_pre_set_clockvm(self, event, name, newvalue, oldvalue=None):
@qubes.events.handler('property-set:clockvm')
def on_property_set_clockvm(self, event, name, newvalue, oldvalue=None):
# pylint: disable=unused-argument,no-self-use
if oldvalue == newvalue:
return
if oldvalue and oldvalue.features.get('service.clocksync', False):
del oldvalue.features['service.clocksync']

Expand Down

0 comments on commit 5d77cf2

Please sign in to comment.