mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Size the device config capability per device
Add a config_size method to VirtioDevice and use it when building the PCI device configuration capability. The transport advertises the size reported by the device and omits the capability entirely when the size is zero, because the virtio driver rejects a zero length capability. The method defaults to None, so every device keeps its current capability size. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
@@ -108,6 +108,10 @@ pub trait VirtioDevice: Send {
|
||||
let _ = value;
|
||||
}
|
||||
|
||||
fn config_size(&self) -> Option<u64> {
|
||||
None
|
||||
}
|
||||
|
||||
/// Reads this device configuration space at `offset`.
|
||||
fn read_config(&self, _offset: u64, _data: &mut [u8]) {
|
||||
warn!(
|
||||
|
||||
Reference in New Issue
Block a user