From 5d77cf22980b607dae601850a0ea1af5e3326195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 30 Nov 2019 05:20:08 +0100 Subject: [PATCH] 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 --- qubes/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qubes/app.py b/qubes/app.py index 0177148f..7e1576b7 100644 --- a/qubes/app.py +++ b/qubes/app.py @@ -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']