summary refs log tree commit diff
path: root/devices/src/proxy.rs
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2018-10-18 16:45:13 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-19 15:07:43 -0700
commit8eceba31c0d2842d8d7bfaa84253121709b1ee81 (patch)
tree35de26e27c5e5a9f91bbdad3ee0ca34f6f1f5b99 /devices/src/proxy.rs
parentf02fdd1f663760fc884073ea74fffb39a3f4ea4c (diff)
downloadcrosvm-8eceba31c0d2842d8d7bfaa84253121709b1ee81.tar
crosvm-8eceba31c0d2842d8d7bfaa84253121709b1ee81.tar.gz
crosvm-8eceba31c0d2842d8d7bfaa84253121709b1ee81.tar.bz2
crosvm-8eceba31c0d2842d8d7bfaa84253121709b1ee81.tar.lz
crosvm-8eceba31c0d2842d8d7bfaa84253121709b1ee81.tar.xz
crosvm-8eceba31c0d2842d8d7bfaa84253121709b1ee81.tar.zst
crosvm-8eceba31c0d2842d8d7bfaa84253121709b1ee81.zip
devices: make PCI work in --disable-sandbox mode
Make the Minijail part of the PCI device tuple optional so that an empty
jail is not created for --disable-sandbox.

BUG=None
TEST=Boot crosvm in both --multiprocess and --disable-sandbox modes

Change-Id: Ibb3f2dbf33ca19910ee7448ea823b2772e09ecc5
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1290289
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'devices/src/proxy.rs')
-rw-r--r--devices/src/proxy.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/devices/src/proxy.rs b/devices/src/proxy.rs
index 478625b..5b79d31 100644
--- a/devices/src/proxy.rs
+++ b/devices/src/proxy.rs
@@ -198,8 +198,10 @@ impl ProxyDevice {
             .map(|_| ())
             .map_err(Error::Io)
     }
+}
 
-    pub fn config_register_write(&mut self, reg_idx: usize, offset: u64, data: &[u8]) {
+impl BusDevice for ProxyDevice {
+    fn config_register_write(&mut self, reg_idx: usize, offset: u64, data: &[u8]) {
         let res = self
             .send_config_cmd(Command::WriteConfig, reg_idx as u32, offset, data)
             .and_then(|_| self.wait());
@@ -208,7 +210,7 @@ impl ProxyDevice {
         }
     }
 
-    pub fn config_register_read(&self, reg_idx: usize) -> u32 {
+    fn config_register_read(&self, reg_idx: usize) -> u32 {
         let mut data = [0u8; 4];
         let res = self
             .send_config_cmd(Command::ReadConfig, reg_idx as u32, 0, &[])
@@ -218,9 +220,7 @@ impl ProxyDevice {
         }
         LittleEndian::read_u32(&data)
     }
-}
 
-impl BusDevice for ProxyDevice {
     fn read(&mut self, offset: u64, data: &mut [u8]) {
         let res = self
             .send_cmd(Command::Read, offset, data.len() as u32, &[])