This patch series attempts to add time resync support to qemu-ga by introducing qemu-ga commands guest-get-time and guest-set-time.
Right now, when a guest is paused or migrated to a file then loaded from that file, the guest OS has no idea that there was a big gap in the time. Depending on how long the gap was, NTP might not be able to resynchronize the guest. So adding new guest-agent command that is called any time a guest is resumed and which tells the guest to update its own wall clock time based on the information from the host will make it easier for a guest to resynchronize without waiting for NTP. The previous RFC send for discussion and suggestion as link here: http://article.gmane.org/gmane.comp.emulators.qemu/186126 The interface for these commands like: { 'command': 'guest-get-time', 'returns': 'TimeInfo' } { 'command': 'guest-set-time', 'data': { '*seconds': 'int', '*microseconds': 'int', '*utc-offset': 'int' } } Notes: I planed to send out this version with the implementition of win32-specific commands, but got some environment issue which I am working on. I will send it out very soon. To avoid wasting of time, I'd like to send this out first with the previous comments fixed to have more suggestions. Suggestions and comments are welcome! Changes since v1: - Squashed patches add support to get host time and add guest-get-time command into one. - Documents improvment based on the suggestions from Eric and Mike. - Change the name of 'HostTimeInfo' to 'TimeInfo'. - Better use-case and logic for 'guest-set-time' command suggested by Eric. - Error handel improvment from Luiz. Lei Li (2): qga: add guest-get-time command qga: add guest-set-time command include/qapi/qmp/qerror.h | 3 + qga/commands-posix.c | 106 +++++++++++++++++++++++++++++++++++++++++++++ qga/qapi-schema.json | 80 ++++++++++++++++++++++++++++++++++ 3 files changed, 189 insertions(+), 0 deletions(-)