qvm-sync-clock: use qubes.SetDateTime service instead of direct "date" call
This way it gives more control over time synchronization to the VM. For example Whonix VMs can decide to not use this mechanism. Also VM can choose how that time will be set (chronyc call?). And finally it will be possible to implement the same for other OS-es (Windows). Additionally because of calling date as "localcmd" each time, instead of once at the beginning, time synchronization is more accurrate now. If some VM stall the time set call, other VMs time will no longer be affected (but still synchronization will be delayed).
This commit is contained in:
parent
e52f0a0566
commit
5f9a30d335
@ -111,8 +111,8 @@ def main():
|
||||
if verbose:
|
||||
print >> sys.stderr, '--> Syncing \'%s\' clock.' % vm.name
|
||||
try:
|
||||
vm.run('date -u -R -s "%s"' % date_out, user="root",
|
||||
gui=False, verbose=verbose)
|
||||
vm.run_service("qubes.SetDateTime", user="root",
|
||||
localcmd="date -u -Iseconds")
|
||||
except Exception as e:
|
||||
print >> sys.stderr, "ERROR syncing time in VM '%s': %s" % (vm.name, str(e))
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user