mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-31 16:36:38 +00:00
runtime-rs: Name the ShareFs Mount Option type more accurately
Fixes: #7915 Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
@@ -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::{
|
||||
|
@@ -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,
|
||||
@@ -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>,
|
||||
|
@@ -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;
|
||||
@@ -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 {
|
||||
|
@@ -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),
|
||||
@@ -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!(
|
||||
|
@@ -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,
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user