Przeglądaj źródła

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).
Marek Marczykowski-Górecki 8 lat temu
rodzic
commit
5f9a30d335
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      qvm-tools/qvm-sync-clock

+ 2 - 2
qvm-tools/qvm-sync-clock

@@ -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