From ebc156186b6263c06deee7f361d7e558d352c2e0 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Mon, 28 Jan 2019 15:32:34 -0800 Subject: [PATCH] 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 Tested-by: kokoro Tested-by: Gurchetan Singh Reviewed-by: Daniel Verkamp --- devices/src/virtio/virtio_device.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/devices/src/virtio/virtio_device.rs b/devices/src/virtio/virtio_device.rs index 82ca012989..64018bdb0e 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)> { None } + + /// Optionally returns additional BAR configuration needed by device + fn get_device_bars(&self) -> Option> { + None + } }