diff options
author | Daniel Verkamp <dverkamp@chromium.org> | 2019-11-01 10:01:23 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-11-18 07:43:03 +0000 |
commit | 24eeed2b6fb6306f404238d1343db4b55aa9beef (patch) | |
tree | 0a347754994d470b3df3e3811430b4da6758ea17 /devices/src/virtio/p9.rs | |
parent | e7c46cad4150ecb18a0832a61042522974543938 (diff) | |
download | crosvm-24eeed2b6fb6306f404238d1343db4b55aa9beef.tar crosvm-24eeed2b6fb6306f404238d1343db4b55aa9beef.tar.gz crosvm-24eeed2b6fb6306f404238d1343db4b55aa9beef.tar.bz2 crosvm-24eeed2b6fb6306f404238d1343db4b55aa9beef.tar.lz crosvm-24eeed2b6fb6306f404238d1343db4b55aa9beef.tar.xz crosvm-24eeed2b6fb6306f404238d1343db4b55aa9beef.tar.zst crosvm-24eeed2b6fb6306f404238d1343db4b55aa9beef.zip |
devices: virtio: pass Interrupt to activate()
Factor out the common creation of struct Interrupt. No functional change. BUG=chromium:854765 TEST=./build_test Change-Id: Idf8804771ba1af5181818f643e15e1b42918258a Signed-off-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1898268 Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'devices/src/virtio/p9.rs')
-rw-r--r-- | devices/src/virtio/p9.rs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/devices/src/virtio/p9.rs b/devices/src/virtio/p9.rs index d891d22..5e483c3 100644 --- a/devices/src/virtio/p9.rs +++ b/devices/src/virtio/p9.rs @@ -8,12 +8,8 @@ use std::mem; use std::os::unix::io::RawFd; use std::path::{Path, PathBuf}; use std::result; -use std::sync::atomic::AtomicUsize; -use std::sync::Arc; use std::thread; -use sync::Mutex; -use crate::pci::MsixConfig; use p9; use sys_util::{error, warn, Error as SysError, EventFd, GuestMemory, PollContext, PollToken}; use virtio_sys::vhost::VIRTIO_F_VERSION_1; @@ -227,10 +223,7 @@ impl VirtioDevice for P9 { fn activate( &mut self, guest_mem: GuestMemory, - interrupt_evt: EventFd, - interrupt_resample_evt: EventFd, - msix_config: Option<Arc<Mutex<MsixConfig>>>, - status: Arc<AtomicUsize>, + interrupt: Interrupt, mut queues: Vec<Queue>, mut queue_evts: Vec<EventFd>, ) { @@ -253,12 +246,7 @@ impl VirtioDevice for P9 { .name("virtio_9p".to_string()) .spawn(move || { let mut worker = Worker { - interrupt: Interrupt::new( - status, - interrupt_evt, - interrupt_resample_evt, - msix_config, - ), + interrupt, mem: guest_mem, queue: queues.remove(0), server, |