瀏覽代碼

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 9 年之前
父節點
當前提交
5f9a30d335
共有 1 個文件被更改,包括 2 次插入2 次删除
  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