diff options
author | Jianxun Zhang <jianxun.zhang@intel.com> | 2019-02-20 13:50:42 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-01 23:41:40 -0800 |
commit | 96f2d8ebe2b2523ed2ca0cf54005ded8d9cd8e4f (patch) | |
tree | 6ca9b383840b91c9f53cefbf02a12dfb64596085 | |
parent | 1a6262bd97d100f455bb01a41c1f3784e3ca143e (diff) | |
download | crosvm-96f2d8ebe2b2523ed2ca0cf54005ded8d9cd8e4f.tar crosvm-96f2d8ebe2b2523ed2ca0cf54005ded8d9cd8e4f.tar.gz crosvm-96f2d8ebe2b2523ed2ca0cf54005ded8d9cd8e4f.tar.bz2 crosvm-96f2d8ebe2b2523ed2ca0cf54005ded8d9cd8e4f.tar.lz crosvm-96f2d8ebe2b2523ed2ca0cf54005ded8d9cd8e4f.tar.xz crosvm-96f2d8ebe2b2523ed2ca0cf54005ded8d9cd8e4f.tar.zst crosvm-96f2d8ebe2b2523ed2ca0cf54005ded8d9cd8e4f.zip |
linux: rename function of device creation
Rename functions and parameters that had 'virtio' in their names because we also create non-virtio devices like audio. BUG=none TEST=emerge-eve crosvm and deploy it to the device, verify some of devices are still created at /sys/bus/virtio/devices/ Change-Id: I3ea75159a865e5f00ecef349725b3c12f94afaca Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1480739 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
-rw-r--r-- | aarch64/src/lib.rs | 4 | ||||
-rw-r--r-- | arch/src/lib.rs | 4 | ||||
-rw-r--r-- | src/linux.rs | 4 | ||||
-rw-r--r-- | x86_64/src/lib.rs | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/aarch64/src/lib.rs b/aarch64/src/lib.rs index b03c3a4..17ec3d9 100644 --- a/aarch64/src/lib.rs +++ b/aarch64/src/lib.rs @@ -197,7 +197,7 @@ impl arch::LinuxArch for AArch64 { fn build_vm<F>( mut components: VmComponents, _split_irqchip: bool, - virtio_devs: F, + create_devices: F, ) -> Result<RunnableLinuxVm> where F: FnOnce( @@ -233,7 +233,7 @@ impl arch::LinuxArch for AArch64 { let exit_evt = EventFd::new().map_err(Error::CreateEventFd)?; - let pci_devices = virtio_devs(&mem, &exit_evt)?; + let pci_devices = create_devices(&mem, &exit_evt)?; let (pci, pci_irqs, pid_debug_label_map) = arch::generate_pci_root(pci_devices, &mut mmio_bus, &mut resources, &mut vm) .map_err(Error::CreatePciRoot)?; diff --git a/arch/src/lib.rs b/arch/src/lib.rs index 2560ff5..4596ee2 100644 --- a/arch/src/lib.rs +++ b/arch/src/lib.rs @@ -76,11 +76,11 @@ pub trait LinuxArch { /// /// * `components` - Parts to use to build the VM. /// * `split_irqchip` - whether to use a split IRQ chip (i.e. userspace PIT/PIC/IOAPIC) - /// * `virtio_devs` - Function to generate a list of virtio devices. + /// * `create_devices` - Function to generate a list of devices. fn build_vm<F>( components: VmComponents, split_irqchip: bool, - virtio_devs: F, + create_devices: F, ) -> Result<RunnableLinuxVm> where F: FnOnce( diff --git a/src/linux.rs b/src/linux.rs index 80c9752..3724985 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -238,7 +238,7 @@ fn simple_jail(cfg: &Config, policy: &str) -> Result<Option<Minijail>> { } } -fn create_virtio_devs( +fn create_devices( cfg: Config, mem: &GuestMemory, _exit_evt: &EventFd, @@ -970,7 +970,7 @@ pub fn run_config(cfg: Config) -> Result<()> { } let linux = Arch::build_vm(components, cfg.split_irqchip, |m, e| { - create_virtio_devs( + create_devices( cfg, m, e, diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs index 69dcf76..01e8f6f 100644 --- a/x86_64/src/lib.rs +++ b/x86_64/src/lib.rs @@ -286,7 +286,7 @@ impl arch::LinuxArch for X8664arch { fn build_vm<F>( mut components: VmComponents, split_irqchip: bool, - virtio_devs: F, + create_devices: F, ) -> Result<RunnableLinuxVm> where F: FnOnce( @@ -322,7 +322,7 @@ impl arch::LinuxArch for X8664arch { let exit_evt = EventFd::new().map_err(Error::CreateEventFd)?; - let pci_devices = virtio_devs(&mem, &exit_evt)?; + let pci_devices = create_devices(&mem, &exit_evt)?; let (pci, pci_irqs, pid_debug_label_map) = arch::generate_pci_root(pci_devices, &mut mmio_bus, &mut resources, &mut vm) .map_err(Error::CreatePciRoot)?; |