From 3c90f9149192c4a710a2dfe597bfb227e4377e06 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 29 Jun 2026 19:15:07 +0200 Subject: [PATCH] virtio-devices: Report no config space for configless devices The watchdog, rng, and rtc devices expose no device specific configuration fields. Each now reports a config size of zero so the transport omits the device configuration capability instead of advertising an unbacked region that the device cannot service. Signed-off-by: Anatol Belski --- virtio-devices/src/rng.rs | 4 ++++ virtio-devices/src/rtc.rs | 4 ++++ virtio-devices/src/watchdog.rs | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/virtio-devices/src/rng.rs b/virtio-devices/src/rng.rs index 227b2a213..eae688ef0 100644 --- a/virtio-devices/src/rng.rs +++ b/virtio-devices/src/rng.rs @@ -230,6 +230,10 @@ impl Rng { } impl VirtioDevice for Rng { + fn config_size(&self) -> Option { + Some(0) + } + fn device_type(&self) -> u32 { self.common.device_type } diff --git a/virtio-devices/src/rtc.rs b/virtio-devices/src/rtc.rs index 57cb73cf3..540508e5e 100644 --- a/virtio-devices/src/rtc.rs +++ b/virtio-devices/src/rtc.rs @@ -601,6 +601,10 @@ impl Rtc { } impl VirtioDevice for Rtc { + fn config_size(&self) -> Option { + Some(0) + } + fn device_type(&self) -> u32 { self.common.device_type } diff --git a/virtio-devices/src/watchdog.rs b/virtio-devices/src/watchdog.rs index 220a5359a..01619f79d 100644 --- a/virtio-devices/src/watchdog.rs +++ b/virtio-devices/src/watchdog.rs @@ -310,6 +310,10 @@ fn timerfd_setup(timer: &File, secs: i64) -> Result<(), io::Error> { } impl VirtioDevice for Watchdog { + fn config_size(&self) -> Option { + Some(0) + } + fn device_type(&self) -> u32 { self.common.device_type }