virtio: Add vhost-user-rtc and vhost-user-rtc-pci
PATCH v2 1/1 virtio: Add vhost-user-rtc and vhost-user-rtc-pci
Authored solely by me for Panasonic Automotive Systems Co., Ltd., but based on existing vhost-user devices I wrote in 2025, so the copyright is mixed.
---
Changes in v2:
- Explain "unusual" authorship situation
- Link to v1: https://lore.kernel.org/qemu-devel/[email protected]
--- include/hw/virtio/vhost-user-rtc.h | 22 ++++++++++ MAINTAINERS | 6 +++ docs/system/devices/virtio/vhost-user.rst | 3 ++ hw/virtio/Kconfig | 5 +++ hw/virtio/meson.build | 3 ++ hw/virtio/vhost-user-rtc-pci.c | 70 +++++++++++++++++++++++++++++++ hw/virtio/vhost-user-rtc.c | 64 ++++++++++++++++++++++++++++ 7 files changed, 173 insertions(+)
include/hw/virtio/vhost-user-rtc.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* Vhost-user RTC virtio device +* +* Copyright (c) 2025 Manos Pitsidianakis <[email protected]> +* Copyright 2026 Panasonic Automotive Systems Co., Ltd. +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#ifndef QEMU_VHOST_USER_RTC_H +#define QEMU_VHOST_USER_RTC_H + +#include "hw/virtio/vhost-user-base.h" + +#define TYPE_VHOST_USER_RTC "vhost-user-rtc" +OBJECT_DECLARE_SIMPLE_TYPE(VHostUserRTC, VHOST_USER_RTC) + +struct VHostUserRTC { +VHostUserBase parent_obj; +}; + +#endif /* QEMU_VHOST_USER_RTC_H */
MAINTAINERS +6 -0
@@ -2573,6 +2573,12 @@ S: Maintained F: include/hw/virtio/vhost-user-spi.h F: hw/virtio/vhost-user-spi* +vhost-user-rtc +M: Manos Pitsidianakis <[email protected]> +S: Supported +F: include/hw/virtio/vhost-user-rtc.h +F: hw/virtio/vhost-user-rtc* + virtio-crypto M: Gonglei <[email protected]> S: Supported
docs/system/devices/virtio/vhost-user.rst +3 -0
@@ -61,6 +61,9 @@ platform details for what sort of virtio bus to use. * - vhost-user-spi - Proxy spi devices to host - `vhost-device-spi <https://github.com/rust-vmm/vhost-device/tree/main/vhost-device-spi>`_ + * - vhost-user-rtc + - Real time clock + - `vhost-device-rtc <https://github.com/rust-vmm/vhost-device/tree/main/vhost-device-rtc>`_ The referenced *daemons* are not exhaustive, any conforming backend implementing the device and using the vhost-user protocol should work.
hw/virtio/Kconfig +5 -0
@@ -136,3 +136,8 @@ config VHOST_USER_TEST bool default y depends on VIRTIO && VHOST_USER + +config VHOST_USER_RTC + bool + default y + depends on VIRTIO && VHOST_USER
hw/virtio/meson.build +3 -0
@@ -27,6 +27,7 @@ if have_vhost system_virtio_ss.add(when: 'CONFIG_VHOST_USER_SND', if_true: files('vhost-user-snd.c')) system_virtio_ss.add(when: 'CONFIG_VHOST_USER_INPUT', if_true: files('vhost-user-input.c')) system_virtio_ss.add(when: 'CONFIG_VHOST_USER_SPI', if_true: files('vhost-user-spi.c')) + system_virtio_ss.add(when: 'CONFIG_VHOST_USER_RTC', if_true: files('vhost-user-rtc.c')) # PCI Stubs system_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_TEST'],
@@ -43,6 +44,8 @@ if have_vhost if_true: files('vhost-user-input-pci.c')) system_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_SPI'], if_true: files('vhost-user-spi-pci.c')) + system_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_RTC'], + if_true: files('vhost-user-rtc-pci.c')) endif if have_vhost_vdpa system_virtio_ss.add(files('vhost-vdpa.c'))
hw/virtio/vhost-user-rtc-pci.c new file +70 -0
70 lines not on this page · raw message
hw/virtio/vhost-user-rtc.c new file +64 -0
64 lines not on this page · raw message
---
base-commit: da6c4fe60fee30dd77267764d55b38af9cb89d4b
change-id: 20260416-vhost-user-rtc-ce8ff0377356
--
γαῖα πυρί μιχθήτω
Quoted 23 lines · nobody
Authored solely by me for Panasonic Automotive Systems Co., Ltd., but based on existing vhost-user devices I wrote in 2025, so the copyright is mixed.
---
Changes in v2:
- Explain "unusual" authorship situation--- include/hw/virtio/vhost-user-rtc.h | 22 ++++++++++ MAINTAINERS | 6 +++ docs/system/devices/virtio/vhost-user.rst | 3 ++ hw/virtio/Kconfig | 5 +++ hw/virtio/meson.build | 3 ++ hw/virtio/vhost-user-rtc-pci.c | 70 +++++++++++++++++++++++++++++++ hw/virtio/vhost-user-rtc.c | 64 ++++++++++++++++++++++++++++ 7 files changed, 173 insertions(+)include/hw/virtio/vhost-user-rtc.h new file +0
-0
include/hw/virtio/vhost-user-rtc.h line 5
Quoted 5 lines
include/hw/virtio/vhost-user-rtc.h new file +5
-0@@ -0,0 +1,22 @@ +/* +* Vhost-user RTC virtio device +* +* Copyright 2026 Panasonic Automotive Systems Co., Ltd. +*
Hmm not sure why my mail client kills your copyright line, but minor nit be consistent with using (or not) (c) for both lines.
Otherwise:
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro