From: Fiona Ebner <f.ebner@proxmox.com>
To: Jakob Klocker <j.klocker@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [PATCH qemu-server v6 3/3] fix #5032: agent: sync guest time via QGA when the clock falls behind
Date: Tue, 17 Nov 2026 09:57:46 +0100 [thread overview]
Message-ID: <99ced6dd-11dd-463d-886e-c09588ef4358@proxmox.com> (raw)
In-Reply-To: <DMWMQKNA9U3Q.9GSB3CN09NUY@proxmox.com>
Am 16.11.26 um 1:21 PM schrieb Jakob Klocker:
> Thanks for the feedback!
> On Fri Nov 13, 2026 at 3:10 PM CET, Fiona Ebner wrote:
>> Am 10.11.26 um 11:49 AM schrieb Jakob Klocker:
>>> + verbose_description =>
>>> + "Override the 'sync-time-on-resume' setting from the VM's guest agent (QGA)"
>>> + . " config for this start only. When enabled, the 'guest-set-time' QEMU guest"
>>> + . " agent command is issued to synchronize the guest's clock to the host's current"
>>> + . " time after the RAM state is restored, which happens here when starting a VM"
>>> + . " that was hibernated (suspended to disk). Without synchronization the guest's"
>>> + . " clock may still reflect the time from when the VM was hibernated. The time is"
>>
>> It's also for migration, or?
>>
>
> No. The migration target is started through this endpoint, but the RAM
> only arrives after vm_start returns AFAICT, so at that point the guest
> is not running yet and the agent can't respond. That's why the sync in
> vm_start_nolock is skipped when 'migratedfrom' is set.
>
> For migration, the clock is synced in vm_resume on the target, when
> the source sends the 'resume' command through the migration tunnel
> after the switchover. That always uses the value from the agent config.
>
Right, thanks for the clarification!
>>> @@ -183,6 +183,19 @@ sub vm_resume($vmid, $skiplock = undef, $nocheck = undef) {
>>> if $resume_cmd eq 'cont';
>>>
>>> mon_cmd($vmid, $resume_cmd);
>>> +
>>> + # A VM in 'prelaunch' never ran, and a VM that shut down during a backup is reset
>>> + # above. Both boot fresh, so the clock is not behind and the agent is not up yet.
>>> + my $guest_was_running = !$reset && ($res->{status} // '') ne 'prelaunch';
>>
>> Nit: could also skip 'shutdown' state for completeness.
>>
>
> That's already covered: $reset is only set for the `shutdown` state,
> and $guest_was_running checks !$reset. I'll check the status directly
> in v7, so this is more obvious. Something along the lines:
>
> my $status = $res->{status} // '';
> my $guest_was_running = $status ne 'prelaunch' && $status ne 'shutdown';
Thanks!
next prev parent reply other threads:[~2026-11-17 8:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 10:45 [PATCH guest-common/manager/qemu-server v6 0/3] fix #5032: add guest time sync via QGA Jakob Klocker
2026-11-10 10:45 ` [PATCH pve-guest-common v6 1/3] AbstractConfig: allow passing options to snapshot_rollback Jakob Klocker
2026-11-13 14:10 ` Fiona Ebner
2026-11-16 12:23 ` Jakob Klocker
2026-11-10 10:46 ` [PATCH pve-manager v6 2/3] fix #5032: ui: qemu agent: add sync-time-on-resume option Jakob Klocker
2026-11-10 10:46 ` [PATCH qemu-server v6 3/3] fix #5032: agent: sync guest time via QGA when the clock falls behind Jakob Klocker
2026-11-13 14:10 ` Fiona Ebner
2026-11-16 12:21 ` Jakob Klocker
2026-11-17 8:57 ` Fiona Ebner [this message]
2026-11-17 12:41 ` superseded: [PATCH guest-common/manager/qemu-server v6 0/3] fix #5032: add guest time sync via QGA 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=99ced6dd-11dd-463d-886e-c09588ef4358@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.