Avoid resetting clocksync service of just enabled clockvm

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
This commit is contained in:
Marek Marczykowski-Górecki 2019-11-30 05:20:08 +01:00
parent 13f35da24a
commit 5d77cf2298
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1473,6 +1473,8 @@ class Qubes(qubes.PropertyHolder):
@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']