public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Jakob Klocker <j.klocker@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Jakob Klocker <j.klocker@proxmox.com>
Subject: [PATCH guest-common/manager/qemu-server v5 0/3] fix #5032: add guest time sync via QGA
Date: Thu, 13 Aug 2026 15:57:10 +0200	[thread overview]
Message-ID: <20260813135713.380802-1-j.klocker@proxmox.com> (raw)

This series adds a new agent option 'sync-time-on-resume' to
automatically synchronize the guest clock via the QEMU Guest Agent 
after operations that can leave the guest time stale. The option is 
disabled by default and only takes effect when the QEMU Guest Agent is
enabled.

When a VM resumes with a restored RAM state (waking from hibernation or
rolling back to a snapshot that includes RAM), the guest clock 
continues from the point the state was saved and no longer matches 
wall-clock time. Skews also appears whenever the guest is briefly 
frozen and resumed - after creating a snapshot, an
ordinary pause/resume, or the resume step of a live migration. 

When enabled, the option triggers a guest-set-time call:
 * after resuming from hibernation (suspend-to-disk)
 * after rolling back to a snapshot that includes RAM
 * after a live migration
 * after an ordinary pause/resume
 * after taking a snapshot

The start, resume and rollback API endpoints also accept a
'sync-time-on-resume' parameter that overrides the configured value for
a single operation. 

The option is exposed in the VM configuration GUI
so it can be toggled per guest.

A version check was added for migration to display a clear error
message in case 'sync-time-on-resume' is enabled and the target doesn't 
support the 'sync-time-on-resume' the option.

Changes since v4:
 * rebased on current master:
 * no functional changes

Link: https://bugzilla.proxmox.com/show_bug.cgi?id=5032


pve-guest-common:

Jakob Klocker (1):
  AbstractConfig: allow passing options to snapshot_rollback

 src/PVE/AbstractConfig.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


pve-manager:

Jakob Klocker (1):
  fix #5032: ui: qemu agent: add sync-time-on-resume option

 www/manager6/form/AgentFeatureSelector.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)


qemu-server:

Jakob Klocker (1):
  fix #5032: agent: sync guest time via QGA when the clock falls behind

 src/PVE/API2/Qemu.pm           | 75 ++++++++++++++++++++++++++++++++--
 src/PVE/CLI/qm.pm              |  2 +-
 src/PVE/QemuConfig.pm          | 12 +++++-
 src/PVE/QemuMigrate.pm         | 13 ++++++
 src/PVE/QemuServer.pm          | 18 +++++++-
 src/PVE/QemuServer/Agent.pm    | 61 +++++++++++++++++++++++++++
 src/PVE/QemuServer/RunState.pm | 11 ++++-
 7 files changed, 183 insertions(+), 9 deletions(-)


Summary over all repositories:
  9 files changed, 204 insertions(+), 11 deletions(-)

-- 
Generated by murpp 0.12.0



             reply	other threads:[~2026-08-13 13:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 13:57 Jakob Klocker [this message]
2026-08-13 13:57 ` [PATCH pve-guest-common v5 1/3] AbstractConfig: allow passing options to snapshot_rollback Jakob Klocker
2026-08-13 13:57 ` [PATCH pve-manager v5 2/3] fix #5032: ui: qemu agent: add sync-time-on-resume option Jakob Klocker
2026-08-13 13:57 ` [PATCH qemu-server v5 3/3] fix #5032: agent: sync guest time via QGA when the clock falls behind Jakob Klocker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260813135713.380802-1-j.klocker@proxmox.com \
    --to=j.klocker@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal