* [Qemu-devel] Missing guest clock-sync on Host clock change
@ 2014-03-27 8:41 Erik Rull
2014-03-27 9:43 ` Laszlo Ersek
0 siblings, 1 reply; 4+ messages in thread
From: Erik Rull @ 2014-03-27 8:41 UTC (permalink / raw)
To: qemu-devel@nongnu.org
Hi all,
I would like to have the guest "drifting" to a new set clock on the host.
My problem is the following:
- Host System (Linux) starts up, hwclock and kernel time are synced, guest
starts up with -rtc clock=host,driftfix=slew (which I assume should fix any
drift issue on ACPI compatible guest OSes)
- Host System kernel time drifts against the hwclock (jiffies timer due to
no other available useful timer on SMP systems - core2duo has no hpet!)
- calling "hwclock -s" on the host resyncs the kernel time with the
hwclock, so "date" and "hwclock" show the same again
- the guest stays at the "old" kernel time before the sync - also after 1
hour the delta is still the same, so no sync or slew is done :-(
My guest OS is Windows 8, which must have ACPI enabled, otherwise it will
not work.
Any ideas how to proceed? Maybe some command line parameters are wrong?
I need this resync for the guest due to external synchronization - it must
not be millisecond-precise, but a 9 seconds shift during a run overnight is
too much!
Thanks.
Best regards,
Erik
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Missing guest clock-sync on Host clock change
2014-03-27 8:41 [Qemu-devel] Missing guest clock-sync on Host clock change Erik Rull
@ 2014-03-27 9:43 ` Laszlo Ersek
2014-03-27 20:14 ` Erik Rull
0 siblings, 1 reply; 4+ messages in thread
From: Laszlo Ersek @ 2014-03-27 9:43 UTC (permalink / raw)
To: Erik Rull, qemu-devel@nongnu.org
On 03/27/14 09:41, Erik Rull wrote:
> Hi all,
>
> I would like to have the guest "drifting" to a new set clock on the host.
>
> My problem is the following:
>
> - Host System (Linux) starts up, hwclock and kernel time are synced,
> guest starts up with -rtc clock=host,driftfix=slew (which I assume
> should fix any drift issue on ACPI compatible guest OSes)
> - Host System kernel time drifts against the hwclock (jiffies timer due
> to no other available useful timer on SMP systems - core2duo has no hpet!)
> - calling "hwclock -s" on the host resyncs the kernel time with the
> hwclock, so "date" and "hwclock" show the same again
> - the guest stays at the "old" kernel time before the sync - also after
> 1 hour the delta is still the same, so no sync or slew is done :-(
>
> My guest OS is Windows 8, which must have ACPI enabled, otherwise it
> will not work.
>
> Any ideas how to proceed? Maybe some command line parameters are wrong?
>
> I need this resync for the guest due to external synchronization - it
> must not be millisecond-precise, but a 9 seconds shift during a run
> overnight is too much!
My take: the hardware clock (the RTC) in the guest has correct value,
but the guest OS system time os not refreshed from it. Install the guest
agent in Windows, and call its "guest-set-time" command (with virsh
qemu-agent-command, or otherwise). Do not pass any argument for the
optional "time" parameter; this way the guest will sync its kernel time
from its RTC.
See:
- qga/qapi-schema.json, "guest-set-time",
- qga/commands-win32.c, qmp_guest_set_time()
In any case this is just a guess.
Laszlo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Missing guest clock-sync on Host clock change
2014-03-27 9:43 ` Laszlo Ersek
@ 2014-03-27 20:14 ` Erik Rull
2014-03-27 20:40 ` Laszlo Ersek
0 siblings, 1 reply; 4+ messages in thread
From: Erik Rull @ 2014-03-27 20:14 UTC (permalink / raw)
To: Laszlo Ersek, qemu-devel@nongnu.org
Laszlo Ersek wrote:
> On 03/27/14 09:41, Erik Rull wrote:
>> Hi all,
>>
>> I would like to have the guest "drifting" to a new set clock on the host.
>>
>> My problem is the following:
>>
>> - Host System (Linux) starts up, hwclock and kernel time are synced,
>> guest starts up with -rtc clock=host,driftfix=slew (which I assume
>> should fix any drift issue on ACPI compatible guest OSes)
>> - Host System kernel time drifts against the hwclock (jiffies timer due
>> to no other available useful timer on SMP systems - core2duo has no hpet!)
>> - calling "hwclock -s" on the host resyncs the kernel time with the
>> hwclock, so "date" and "hwclock" show the same again
>> - the guest stays at the "old" kernel time before the sync - also after
>> 1 hour the delta is still the same, so no sync or slew is done :-(
>>
>> My guest OS is Windows 8, which must have ACPI enabled, otherwise it
>> will not work.
>>
>> Any ideas how to proceed? Maybe some command line parameters are wrong?
>>
>> I need this resync for the guest due to external synchronization - it
>> must not be millisecond-precise, but a 9 seconds shift during a run
>> overnight is too much!
>
> My take: the hardware clock (the RTC) in the guest has correct value,
> but the guest OS system time os not refreshed from it. Install the guest
> agent in Windows, and call its "guest-set-time" command (with virsh
> qemu-agent-command, or otherwise). Do not pass any argument for the
> optional "time" parameter; this way the guest will sync its kernel time
> from its RTC.
>
> See:
> - qga/qapi-schema.json, "guest-set-time",
> - qga/commands-win32.c, qmp_guest_set_time()
>
> In any case this is just a guess.
>
> Laszlo
>
Hi Laszlo,
thanks, I will try that, but might take some time, because the changes for
the qemu-ga are bigger to activate. Is there a possiblity to set the RTC of
the guest automatically in sync with the host hardware RTC? I didn't find a
parameter for that.
Best regards,
Erik
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Missing guest clock-sync on Host clock change
2014-03-27 20:14 ` Erik Rull
@ 2014-03-27 20:40 ` Laszlo Ersek
0 siblings, 0 replies; 4+ messages in thread
From: Laszlo Ersek @ 2014-03-27 20:40 UTC (permalink / raw)
To: Erik Rull, qemu-devel@nongnu.org
On 03/27/14 21:14, Erik Rull wrote:
> Laszlo Ersek wrote:
>> On 03/27/14 09:41, Erik Rull wrote:
>>> Hi all,
>>>
>>> I would like to have the guest "drifting" to a new set clock on the
>>> host.
>>>
>>> My problem is the following:
>>>
>>> - Host System (Linux) starts up, hwclock and kernel time are synced,
>>> guest starts up with -rtc clock=host,driftfix=slew (which I assume
>>> should fix any drift issue on ACPI compatible guest OSes)
>>> - Host System kernel time drifts against the hwclock (jiffies timer due
>>> to no other available useful timer on SMP systems - core2duo has no
>>> hpet!)
>>> - calling "hwclock -s" on the host resyncs the kernel time with the
>>> hwclock, so "date" and "hwclock" show the same again
>>> - the guest stays at the "old" kernel time before the sync - also after
>>> 1 hour the delta is still the same, so no sync or slew is done :-(
>>>
>>> My guest OS is Windows 8, which must have ACPI enabled, otherwise it
>>> will not work.
>>>
>>> Any ideas how to proceed? Maybe some command line parameters are wrong?
>>>
>>> I need this resync for the guest due to external synchronization - it
>>> must not be millisecond-precise, but a 9 seconds shift during a run
>>> overnight is too much!
>>
>> My take: the hardware clock (the RTC) in the guest has correct value,
>> but the guest OS system time os not refreshed from it. Install the guest
>> agent in Windows, and call its "guest-set-time" command (with virsh
>> qemu-agent-command, or otherwise). Do not pass any argument for the
>> optional "time" parameter; this way the guest will sync its kernel time
>> from its RTC.
>>
>> See:
>> - qga/qapi-schema.json, "guest-set-time",
>> - qga/commands-win32.c, qmp_guest_set_time()
>>
>> In any case this is just a guess.
>>
>> Laszlo
>>
>
> Hi Laszlo,
>
> thanks, I will try that, but might take some time, because the changes
> for the qemu-ga are bigger to activate. Is there a possiblity to set the
> RTC of the guest automatically in sync with the host hardware RTC? I
> didn't find a parameter for that.
Again, I have no clue, but my impression is that the guest's RTC is
already OK.
However, same as on Linux, the RTC and the system time are independent,
likely in Windows too, unless you sync them somehow periodically. You
need the equivalent of "hwclock --hctosys" in the Windows guest (which
the qga command provides for you), otherwise processes in the Windows
guest won't see the correct time (they don't care about the RTC, same as
Linux processes don't.)
Laszlo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-27 20:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27 8:41 [Qemu-devel] Missing guest clock-sync on Host clock change Erik Rull
2014-03-27 9:43 ` Laszlo Ersek
2014-03-27 20:14 ` Erik Rull
2014-03-27 20:40 ` Laszlo Ersek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).