diff options
author | Dylan Reid <dgreid@chromium.org> | 2018-07-09 15:39:34 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-01 11:29:59 -0700 |
commit | 0f579cb09c7a2e9cf176c2a689a51ba440398957 (patch) | |
tree | 275757e7698882b426e7a005933953b80783e28e /src/linux.rs | |
parent | b605850bce94e476539a0843cae2092d91daff5a (diff) | |
download | crosvm-0f579cb09c7a2e9cf176c2a689a51ba440398957.tar crosvm-0f579cb09c7a2e9cf176c2a689a51ba440398957.tar.gz crosvm-0f579cb09c7a2e9cf176c2a689a51ba440398957.tar.bz2 crosvm-0f579cb09c7a2e9cf176c2a689a51ba440398957.tar.lz crosvm-0f579cb09c7a2e9cf176c2a689a51ba440398957.tar.xz crosvm-0f579cb09c7a2e9cf176c2a689a51ba440398957.tar.zst crosvm-0f579cb09c7a2e9cf176c2a689a51ba440398957.zip |
move pci root creation to arch
passing everything in to the pci code is getting annoying. Instead build it up in arch which already has access to all the needed resources. Change-Id: If42f994443c4f11152fca8da16f27fa4cd80580d Reviewed-on: https://chromium-review.googlesource.com/1237357 Commit-Ready: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'src/linux.rs')
-rw-r--r-- | src/linux.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/linux.rs b/src/linux.rs index 5b46663..1496998 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -25,7 +25,7 @@ use rand::thread_rng; use rand::distributions::{IndependentSample, Range}; use byteorder::{ByteOrder, LittleEndian}; -use devices; +use devices::{self, PciDevice}; use io_jail::{self, Minijail}; use kvm::*; use net_util::Tap; @@ -75,14 +75,14 @@ pub enum Error { QcowDeviceCreate(qcow::Error), ReadLowmemAvailable(io::Error), ReadLowmemMargin(io::Error), - RegisterBalloon(arch::MmioRegisterError), - RegisterBlock(arch::MmioRegisterError), - RegisterGpu(arch::MmioRegisterError), - RegisterNet(arch::MmioRegisterError), - RegisterP9(arch::MmioRegisterError), - RegisterRng(arch::MmioRegisterError), + RegisterBalloon(arch::DeviceRegistrationError), + RegisterBlock(arch::DeviceRegistrationError), + RegisterGpu(arch::DeviceRegistrationError), + RegisterNet(arch::DeviceRegistrationError), + RegisterP9(arch::DeviceRegistrationError), + RegisterRng(arch::DeviceRegistrationError), RegisterSignalHandler(sys_util::Error), - RegisterWayland(arch::MmioRegisterError), + RegisterWayland(arch::DeviceRegistrationError), ResetTimerFd(sys_util::Error), RngDeviceNew(devices::virtio::RngError), SettingGidMap(io_jail::Error), @@ -695,7 +695,7 @@ pub fn run_config(cfg: Config) -> Result<()> { info!("crosvm entering multiprocess mode"); } - let pci_devices = devices::PciDeviceList::new(); + let pci_devices: Vec<(Box<PciDevice + 'static>, Minijail)> = Vec::new(); // Masking signals is inherently dangerous, since this can persist across clones/execs. Do this // before any jailed devices have been spawned, so that we can catch any of them that fail very |