Repository navigation
virtio-rtc: advertise smeared UTC clock type - #5191
Open
Daniel Urbonas (d-urbonas) wants to merge 5 commits into
Open
Daniel Urbonas (d-urbonas) wants to merge 5 commits into
Daniel Urbonas (d-urbonas) wants to merge 5 commits into
Conversation
Daniel Urbonas (d-urbonas)
requested review from
a team and
Anatol Belski (weltling)
as code owners
November 20, 2026 21:17
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the virtio-rtc clock-advertisement update.
No open issues 🎉
What changed in this PR
This PR changes OpenVMM’s virtio-rtc clock advertisement to UTC_SMEARED, allowing Linux’s virtio RTC driver to register an RTC-class device while retaining host wall time as the clock source.
Changes:
- Replace
UTC_MAYBE_SMEAREDwithUTC_SMEAREDin the protocol constant and capability response. - Update the capability test to expect the new clock type.
- Align Guide documentation and describe Linux RTC registration and boot-time clock initialization.
| File | Description |
|---|---|
| vm/devices/virtio/virtio_rtc/src/tests.rs | Update the expected clock capability. |
| vm/devices/virtio/virtio_rtc/src/spec.rs | Define CLOCK_UTC_SMEARED with protocol value 3. |
| vm/devices/virtio/virtio_rtc/src/lib.rs | Advertise the smeared UTC clock type. |
| Guide/src/reference/openvmm/management/cli.md | Update the CLI reference’s clock description. |
| Guide/src/reference/devices/virtio/rtc.md | Clarify clock behavior and Linux RTC/PTP configuration. |
Review effort: Balanced
Steven Malis (smalis-msft)
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Linux virtio_rtc driver only registers an RTC class device when the clock type is VIRTIO_RTC_CLOCK_UTC_SMEARED. As of October, there are no more leap seconds, so we can advertise our clock in this way such that the guest can expose the device.