diff options
author | Gurchetan Singh <gurchetansingh@chromium.org> | 2019-01-28 15:32:34 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-01 01:08:28 -0800 |
commit | ebc156186b6263c06deee7f361d7e558d352c2e0 (patch) | |
tree | 4ad70d0e8024438c9006fe1cfa92ab524fb433d4 | |
parent | 036ba3390bfd31a3eeae07186cb9e4933fa5ddc3 (diff) | |
download | crosvm-ebc156186b6263c06deee7f361d7e558d352c2e0.tar crosvm-ebc156186b6263c06deee7f361d7e558d352c2e0.tar.gz crosvm-ebc156186b6263c06deee7f361d7e558d352c2e0.tar.bz2 crosvm-ebc156186b6263c06deee7f361d7e558d352c2e0.tar.lz crosvm-ebc156186b6263c06deee7f361d7e558d352c2e0.tar.xz crosvm-ebc156186b6263c06deee7f361d7e558d352c2e0.tar.zst crosvm-ebc156186b6263c06deee7f361d7e558d352c2e0.zip |
devices: virtio: add PCI configuration callback function
The idea is that virtio devices can specify additional memory regions. BUG=chromium:924405 TEST=run VM Change-Id: I2a9f233ca8e2bc4fd9b05ee83101b11deb6e7b04 Reviewed-on: https://chromium-review.googlesource.com/1480742 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Gurchetan Singh <gurchetansingh@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
-rw-r--r-- | devices/src/virtio/virtio_device.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/devices/src/virtio/virtio_device.rs b/devices/src/virtio/virtio_device.rs index 82ca012..64018bd 100644 --- a/devices/src/virtio/virtio_device.rs +++ b/devices/src/virtio/virtio_device.rs @@ -7,6 +7,7 @@ use std::sync::atomic::AtomicUsize; use std::sync::Arc; use super::*; +use pci::PciBarConfiguration; use sys_util::{EventFd, GuestMemory}; /// Trait for virtio devices to be driven by a virtio transport. @@ -73,4 +74,9 @@ pub trait VirtioDevice: Send { fn reset(&mut self) -> Option<(EventFd, Vec<EventFd>)> { None } + + /// Optionally returns additional BAR configuration needed by device + fn get_device_bars(&self) -> Option<Vec<PciBarConfiguration>> { + None + } } |