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 /aarch64/src/lib.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 'aarch64/src/lib.rs')
-rw-r--r-- | aarch64/src/lib.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/aarch64/src/lib.rs b/aarch64/src/lib.rs index cb39897..e78ee55 100644 --- a/aarch64/src/lib.rs +++ b/aarch64/src/lib.rs @@ -107,8 +107,6 @@ const AARCH64_IRQ_BASE: u32 = 1; #[derive(Debug)] pub enum Error { - /// Error Adding a PCI device. - AddPciDev(devices::PciRootError), /// Unable to clone an EventFd CloneEventFd(sys_util::Error), /// Error creating kernel command line. @@ -118,7 +116,7 @@ pub enum Error { /// Unable to create Kvm. CreateKvm(sys_util::Error), /// Unable to create a PciRoot hub. - CreatePciRoot(devices::PciRootError), + CreatePciRoot(arch::DeviceRegistrationError), /// Unable to create socket. CreateSocket(io::Error), /// Unable to create Vcpu. @@ -130,7 +128,7 @@ pub enum Error { /// Failure to Create GIC CreateGICFailure(sys_util::Error), /// Couldn't register virtio socket. - RegisterVsock(arch::MmioRegisterError), + RegisterVsock(arch::DeviceRegistrationError), /// VCPU Init failed VCPUInitFailure, /// VCPU Set one reg failed @@ -140,7 +138,6 @@ pub enum Error { impl error::Error for Error { fn description(&self) -> &str { match self { - &Error::AddPciDev(_) => "Failed to add device to PCI", &Error::CloneEventFd(_) => "Unable to clone an EventFd", &Error::Cmdline(_) => "the given kernel command line was invalid", &Error::CreateEventFd(_) => "Unable to make an EventFd", @@ -210,7 +207,9 @@ impl arch::LinuxArch for AArch64 { let mut mmio_bus = devices::Bus::new(); - let (pci, pci_irqs) = components.pci_devices.generate_root(&mut mmio_bus, &mut resources) + let (pci, pci_irqs) = arch::generate_pci_root(components.pci_devices, + &mut mmio_bus, + &mut resources) .map_err(Error::CreatePciRoot)?; let exit_evt = EventFd::new().map_err(Error::CreateEventFd)?; |