Skip to content

Commit

Permalink
runtime-rs: Name the ShareFs Mount Option type more accurately
Browse files Browse the repository at this point in the history
Fixes: #7915

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
  • Loading branch information
Apokleos committed Nov 14, 2023
1 parent 6918a34 commit 8192c2a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/runtime-rs/crates/hypervisor/src/device/driver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub use virtio_blk::{
VIRTIO_BLOCK_MMIO, VIRTIO_BLOCK_PCI, VIRTIO_PMEM,
};
pub use virtio_fs::{
ShareFsConfig, ShareFsDevice, ShareFsMountConfig, ShareFsMountType, ShareFsOperation,
ShareFsConfig, ShareFsDevice, ShareFsMountConfig, ShareFsMountOperation, ShareFsMountType,
};
pub use virtio_net::{Address, Backend, NetworkConfig, NetworkDevice};
pub use virtio_vsock::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use async_trait::async_trait;
use crate::device::{hypervisor, Device, DeviceType};

#[derive(Copy, Clone, Debug, Default)]
pub enum ShareFsOperation {
pub enum ShareFsMountOperation {
#[default]
Mount,
Umount,
Expand Down Expand Up @@ -43,7 +43,7 @@ pub struct ShareFsMountConfig {
pub tag: String,

/// op: the operation to take, e.g. mount, umount or update
pub op: ShareFsOperation,
pub op: ShareFsMountOperation,

/// prefetch_list_path: path to file that contains file lists that should be prefetched by rafs
pub prefetch_list_path: Option<String>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use dragonball::device_manager::blk_dev_mgr::BlockDeviceType;
use super::DragonballInner;
use crate::{
device::DeviceType, HybridVsockConfig, NetworkConfig, ShareFsConfig, ShareFsMountConfig,
ShareFsMountType, ShareFsOperation, VfioBusMode, VfioDevice, VmmState, JAILER_ROOT,
ShareFsMountOperation, ShareFsMountType, VfioBusMode, VfioDevice, VmmState, JAILER_ROOT,
};

const MB_TO_B: u32 = 1024 * 1024;
Expand Down Expand Up @@ -346,9 +346,9 @@ impl DragonballInner {

fn add_share_fs_mount(&mut self, config: &ShareFsMountConfig) -> Result<()> {
let ops = match config.op {
ShareFsOperation::Mount => "mount",
ShareFsOperation::Umount => "umount",
ShareFsOperation::Update => "update",
ShareFsMountOperation::Mount => "mount",
ShareFsMountOperation::Umount => "umount",
ShareFsMountOperation::Update => "update",
};

let fstype = match config.fstype {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use nix::sched::{setns, CloneFlags};
use seccompiler::BpfProgram;
use vmm_sys_util::eventfd::EventFd;

use crate::ShareFsOperation;
use crate::ShareFsMountOperation;

pub enum Request {
Sync(VmmAction),
Expand Down Expand Up @@ -238,7 +238,7 @@ impl VmmInstance {
Ok(())
}

pub fn patch_fs(&self, cfg: &FsMountConfigInfo, op: ShareFsOperation) -> Result<()> {
pub fn patch_fs(&self, cfg: &FsMountConfigInfo, op: ShareFsMountOperation) -> Result<()> {
self.handle_request(Request::Sync(VmmAction::ManipulateFsBackendFs(cfg.clone())))
.with_context(|| {
format!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use tokio::sync::RwLock;
use hypervisor::{
device::{
device_manager::{do_handle_device, do_update_device, DeviceManager},
driver::{ShareFsMountConfig, ShareFsMountType, ShareFsOperation},
driver::{ShareFsMountConfig, ShareFsMountOperation, ShareFsMountType},
DeviceConfig,
},
ShareFsConfig,
Expand Down Expand Up @@ -89,7 +89,7 @@ pub(crate) async fn setup_inline_virtiofs(d: &RwLock<DeviceManager>, id: &str) -
mount_point: mnt,
config: None,
tag: String::from(MOUNT_GUEST_TAG),
op: ShareFsOperation::Mount,
op: ShareFsMountOperation::Mount,
prefetch_list_path: None,
};

Expand Down Expand Up @@ -126,7 +126,7 @@ pub async fn rafs_mount(
mount_point: rafs_mnt,
config: Some(config_content),
tag: String::from(MOUNT_GUEST_TAG),
op: ShareFsOperation::Mount,
op: ShareFsMountOperation::Mount,
prefetch_list_path,
};

Expand Down

0 comments on commit 8192c2a

Please sign in to comment.