ee3950a3aa
After suspend VMs clocks are desynchronized in most cases (because VMs were paused). Since directly after suspent there may be no network access, normal `qvm-sync-clock` call isn't good (it aborts if NTP call fails). But with new `qvm-sync-clock --force` switch, it sync VMs even if NTP is unreachable. QubesOS/qubes-issues#1728
18 lines
422 B
Bash
Executable File
18 lines
422 B
Bash
Executable File
#!/bin/sh
|
|
|
|
sync_qubes_vms_wallclock()
|
|
{
|
|
# Sync all VMs (based on dom0 clock if network time sync fails)
|
|
/usr/bin/qvm-sync-clock --force &
|
|
}
|
|
|
|
case "$1" in
|
|
thaw|resume) sync_qubes_vms_wallclock ;;
|
|
# Kill qvm-sync-clock (if running) to not desync time after resume
|
|
suspend|hibernate)
|
|
killall qvm-sync-clock 2> /dev/null
|
|
exit 0
|
|
;;
|
|
*) exit 0 ;;
|
|
esac
|