-
Notifications
You must be signed in to change notification settings - Fork 669
Add hwclock sync loop to the guestagent #490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1c74e71
to
5d4dc5e
Compare
5d4dc5e
to
2f0286f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and worked in my testing.
I do think the threshold should be lower, but that is more a gut feeling without supporting data.
Signed-off-by: Mikhail Lukianchenko <[email protected]>
d3f6bb5
to
dae7ddd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, LGTM. Leaving for @AkihiroSuda to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this "recursion"
#490 (comment)
Signed-off-by: Mikhail Lukianchenko <[email protected]>
d9c9b09
to
9d2bb68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Addresses #355
Running qemu guest agent alone doesn't solve the problem. With that approach, there must be an actor on the host side which catches wakeup events and executes RPC calls on the guest agent socket. As it stands, lima doesn't have any permanently running process to relay wake up events.
This PR offers different approach. It turns out that hardware clock device (
/dev/rtc0
) forwarded into a guest by QEMU always contains correct host time. The PR adds a loop into lima guest agent. That loop periodically checks the difference between hw clock time and system time. If the diff turns out to be over certain limit (hardcoded 5 seconds for now), the loop launches time sync from hw clock to system time.