diff --git a/vm-virtio/src/lib.rs b/vm-virtio/src/lib.rs index 4133b6cf8..4cc5b9d62 100755 --- a/vm-virtio/src/lib.rs +++ b/vm-virtio/src/lib.rs @@ -23,7 +23,6 @@ use std::io; mod block; mod console; mod device; -pub mod fs; pub mod net; mod pmem; mod queue; @@ -35,7 +34,6 @@ pub mod vhost_user; pub use self::block::*; pub use self::console::*; pub use self::device::*; -pub use self::fs::*; pub use self::net::*; pub use self::pmem::*; pub use self::queue::*; @@ -126,7 +124,7 @@ pub enum ActivateError { /// Failed to create Vhost-user interrupt eventfd VhostIrqCreate, /// Failed to setup vhost-user daemon. - VhostUserSetup(fs::Error), + VhostUserSetup(vhost_user::fs::Error), /// Failed to setup vhost-user daemon. VhostUserNetSetup(vhost_user::Error), } @@ -153,7 +151,4 @@ pub enum Error { EpollCtl(io::Error), EpollWait(io::Error), FailedSignalingDriver(io::Error), - - /// Failed to handle vhost-user slave request. - VhostUserSlaveRequest(vhost_rs::vhost_user::Error), } diff --git a/vm-virtio/src/fs.rs b/vm-virtio/src/vhost_user/fs.rs similarity index 99% rename from vm-virtio/src/fs.rs rename to vm-virtio/src/vhost_user/fs.rs index db81d13e0..78771d5b5 100644 --- a/vm-virtio/src/fs.rs +++ b/vm-virtio/src/vhost_user/fs.rs @@ -2,9 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 use super::Error as DeviceError; -use super::{ActivateError, ActivateResult, Queue, VirtioDevice, VirtioDeviceType}; use crate::{ - VirtioInterrupt, VirtioInterruptType, VirtioSharedMemoryList, VIRTIO_F_VERSION_1_BITMASK, + ActivateError, ActivateResult, Queue, VirtioDevice, VirtioDeviceType, + VirtioInterrupt, VirtioInterruptType, VirtioSharedMemoryList, + VIRTIO_F_VERSION_1_BITMASK, }; use epoll; use libc::{self, EFD_NONBLOCK}; diff --git a/vm-virtio/src/vhost_user/mod.rs b/vm-virtio/src/vhost_user/mod.rs index 0a82a57a0..72c23b768 100644 --- a/vm-virtio/src/vhost_user/mod.rs +++ b/vm-virtio/src/vhost_user/mod.rs @@ -12,10 +12,12 @@ use std::io; use vhost_rs::Error as VhostError; use vm_memory::Error as MmapError; +pub mod fs; mod handler; pub mod net; pub mod vu_common_ctrl; +pub use self::fs::*; pub use self::net::Net; pub use self::vu_common_ctrl::VhostUserConfig; @@ -81,6 +83,8 @@ pub enum Error { VhostIrqRead(io::Error), /// Failed to read vhost eventfd. VhostUserMemoryRegion(MmapError), + /// Failed to handle vhost-user slave request. + VhostUserSlaveRequest(vhost_rs::vhost_user::Error), /// Invalid used address. UsedAddress, } diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 4bb50e021..d31fdd727 100755 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -250,7 +250,7 @@ pub enum DeviceManagerError { CreateVirtioRng(io::Error), /// Cannot create virtio-fs device - CreateVirtioFs(vm_virtio::fs::Error), + CreateVirtioFs(vm_virtio::vhost_user::fs::Error), /// Cannot create virtio-pmem device CreateVirtioPmem(io::Error), @@ -968,7 +968,7 @@ impl DeviceManager { )); } - let virtio_fs_device = vm_virtio::Fs::new( + let virtio_fs_device = vm_virtio::vhost_user::Fs::new( fs_sock, fs_cfg.tag, fs_cfg.num_queues,