virtio-rtc: Report smeared UTC clock type
PATCH 1/1 virtio-rtc: Report smeared UTC clock type
The Linux virtio_rtc driver only registers an RTC class device when the clock type is VIRTIO_RTC_CLOCK_UTC_SMEARED to avoid leap second steps on pure UTC clocks.
Report VIRTIO_RTC_CLOCK_UTC_SMEARED in clock capabilities so the guest can expose the device as an RTC device.
Signed-off-by Kuan-Wei Chiu <[email protected]>
--- hw/virtio/virtio-rtc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/virtio/virtio-rtc.c +2 -1
@@ -62,7 +62,8 @@ static void virtio_rtc_handle_request(VirtIODevice *vdev, VirtQueue *vq) resp.head.status =VIRTIO_RTC_S_ENODEV ; }else { resp.head.status =VIRTIO_RTC_S_OK ; - resp.type =VIRTIO_RTC_CLOCK_UTC ; + resp.type =VIRTIO_RTC_CLOCK_UTC_SMEARED ; + resp.leap_second_smearing =VIRTIO_RTC_SMEAR_UNSPECIFIED ; } written =iov_from_buf (elem->in_sg, elem->in_num,0 , &resp,sizeof (resp));
Signature · 1 line
2.55.0.897.gb25b4bd76c-goog