From 0f579cb09c7a2e9cf176c2a689a51ba440398957 Mon Sep 17 00:00:00 2001 From: Dylan Reid Date: Mon, 9 Jul 2018 15:39:34 -0700 Subject: 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 Tested-by: Daniel Verkamp Reviewed-by: Dylan Reid --- src/linux.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/linux.rs') 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, 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 -- cgit 1.4.1