Skip to content

Commit

Permalink
Merge pull request #5105 from liubin/fix/5104-ignore-virtiofs-daemon-…
Browse files Browse the repository at this point in the history
…for-inline-mode

kata-types: don't check virtio_fs_daemon for inline-virtio-fs
  • Loading branch information
liubin committed Sep 13, 2022
2 parents 42d4da9 + fc9c6f8 commit a58feba
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/libs/kata-types/src/config/hypervisor/mod.rs
Expand Up @@ -818,11 +818,15 @@ impl SharedFsInfo {
validate_path_pattern(&self.valid_virtio_fs_daemon_paths, path)
}

fn adjust_virtio_fs(&mut self, _inline: bool) -> Result<()> {
resolve_path!(
self.virtio_fs_daemon,
"Virtio-fs daemon path {} is invalid: {}"
)?;
fn adjust_virtio_fs(&mut self, inline: bool) -> Result<()> {
// inline mode doesn't need external virtiofsd daemon
if !inline {
resolve_path!(
self.virtio_fs_daemon,
"Virtio-fs daemon path {} is invalid: {}"
)?;
}

if self.virtio_fs_cache.is_empty() {
self.virtio_fs_cache = default::DEFAULT_VIRTIO_FS_CACHE_MODE.to_string();
}
Expand All @@ -836,16 +840,13 @@ impl SharedFsInfo {
}

fn validate_virtio_fs(&self, inline: bool) -> Result<()> {
if inline && !self.virtio_fs_daemon.is_empty() {
return Err(eother!(
"Executable path for inline-virtio-fs is not empty: {}",
&self.virtio_fs_daemon
));
// inline mode doesn't need external virtiofsd daemon
if !inline {
validate_path!(
self.virtio_fs_daemon,
"Virtio-fs daemon path {} is invalid: {}"
)?;
}
validate_path!(
self.virtio_fs_daemon,
"Virtio-fs daemon path {} is invalid: {}"
)?;

let l = ["none", "auto", "always"];

Expand Down

0 comments on commit a58feba

Please sign in to comment.