mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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 <anbelski@linux.microsoft.com>
This commit is contained in:
@@ -230,6 +230,10 @@ impl Rng {
|
||||
}
|
||||
|
||||
impl VirtioDevice for Rng {
|
||||
fn config_size(&self) -> Option<u64> {
|
||||
Some(0)
|
||||
}
|
||||
|
||||
fn device_type(&self) -> u32 {
|
||||
self.common.device_type
|
||||
}
|
||||
|
||||
@@ -601,6 +601,10 @@ impl Rtc {
|
||||
}
|
||||
|
||||
impl VirtioDevice for Rtc {
|
||||
fn config_size(&self) -> Option<u64> {
|
||||
Some(0)
|
||||
}
|
||||
|
||||
fn device_type(&self) -> u32 {
|
||||
self.common.device_type
|
||||
}
|
||||
|
||||
@@ -310,6 +310,10 @@ fn timerfd_setup(timer: &File, secs: i64) -> Result<(), io::Error> {
|
||||
}
|
||||
|
||||
impl VirtioDevice for Watchdog {
|
||||
fn config_size(&self) -> Option<u64> {
|
||||
Some(0)
|
||||
}
|
||||
|
||||
fn device_type(&self) -> u32 {
|
||||
self.common.device_type
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user