Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-vmm-ci
2 changes: 2 additions & 0 deletions vhost-user-backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ xen = ["vm-memory/xen", "vhost/xen"]
postcopy = ["vhost/postcopy", "userfaultfd"]

[dependencies]
bitflags = "2.9.1"
libc = "0.2.39"
log = "0.4.17"
mio = { version = "1.0.4", features = ["os-poll", "os-ext"] }
userfaultfd = { version = "0.8.1", optional = true }
vhost = { path = "../vhost", version = "0.14.0", features = ["vhost-user-backend"] }
virtio-bindings = { workspace = true }
Expand Down
17 changes: 9 additions & 8 deletions vhost-user-backend/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ use std::io::Result;
use std::ops::Deref;
use std::sync::{Arc, Mutex, RwLock};

use mio::Interest;
use vhost::vhost_user::message::{
VhostTransferStateDirection, VhostTransferStatePhase, VhostUserProtocolFeatures,
VhostUserSharedMsg,
};
use vhost::vhost_user::Backend;
use vm_memory::bitmap::Bitmap;
use vmm_sys_util::epoll::EventSet;
use vmm_sys_util::eventfd::EventFd;

use vhost::vhost_user::GpuBackend;
Expand Down Expand Up @@ -144,7 +144,7 @@ pub trait VhostUserBackend: Send + Sync {
fn handle_event(
&self,
device_event: u16,
evset: EventSet,
evset: Interest,
vrings: &[Self::Vring],
thread_id: usize,
) -> Result<()>;
Expand Down Expand Up @@ -287,7 +287,7 @@ pub trait VhostUserBackendMut: Send + Sync {
fn handle_event(
&mut self,
device_event: u16,
evset: EventSet,
evset: Interest,
vrings: &[Self::Vring],
thread_id: usize,
) -> Result<()>;
Expand Down Expand Up @@ -389,7 +389,7 @@ impl<T: VhostUserBackend> VhostUserBackend for Arc<T> {
fn handle_event(
&self,
device_event: u16,
evset: EventSet,
evset: Interest,
vrings: &[Self::Vring],
thread_id: usize,
) -> Result<()> {
Expand Down Expand Up @@ -478,7 +478,7 @@ impl<T: VhostUserBackendMut> VhostUserBackend for Mutex<T> {
fn handle_event(
&self,
device_event: u16,
evset: EventSet,
evset: Interest,
vrings: &[Self::Vring],
thread_id: usize,
) -> Result<()> {
Expand Down Expand Up @@ -570,7 +570,7 @@ impl<T: VhostUserBackendMut> VhostUserBackend for RwLock<T> {
fn handle_event(
&self,
device_event: u16,
evset: EventSet,
evset: Interest,
vrings: &[Self::Vring],
thread_id: usize,
) -> Result<()> {
Expand Down Expand Up @@ -600,6 +600,7 @@ pub mod tests {
use super::*;
use crate::VringRwLock;
use libc::EFD_NONBLOCK;
use mio::Interest;
use std::sync::Mutex;
use uuid::Uuid;
use vm_memory::{GuestAddress, GuestMemoryAtomic, GuestMemoryMmap};
Expand Down Expand Up @@ -707,7 +708,7 @@ pub mod tests {
fn handle_event(
&mut self,
_device_event: u16,
_evset: EventSet,
_evset: Interest,
_vrings: &[VringRwLock],
_thread_id: usize,
) -> Result<()> {
Expand Down Expand Up @@ -793,7 +794,7 @@ pub mod tests {

let vring = VringRwLock::new(mem, 0x1000).unwrap();
backend
.handle_event(0x1, EventSet::IN, &[vring], 0)
.handle_event(0x1, Interest::READABLE, &[vring], 0)
.unwrap();

backend.reset_device();
Expand Down
Loading