-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4462 from wasmerio/dproxy
Implemented DProxy which gives fuse mounting of journals, memory and thread snapshots and implements the majority of the snapshot filters
- Loading branch information
Showing
144 changed files
with
8,334 additions
and
1,661 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use std::{path::PathBuf, process::Stdio}; | ||
|
||
use clap::Parser; | ||
use wasmer_wasix::fs::WasiFdSeed; | ||
|
||
use super::fs::JournalFileSystemBuilder; | ||
use crate::commands::CliCommand; | ||
|
||
/// Mounts a journal as a file system on the local machine | ||
#[derive(Debug, Parser)] | ||
pub struct CmdJournalMount { | ||
/// Path to the journal that will be printed | ||
#[clap(index = 1)] | ||
journal_path: PathBuf, | ||
/// Path to the directory where the file system will be mounted | ||
#[clap(index = 2)] | ||
mount_path: PathBuf, | ||
} | ||
|
||
impl CliCommand for CmdJournalMount { | ||
type Output = (); | ||
|
||
fn run(self) -> Result<(), anyhow::Error> { | ||
// First we unmount any existing file system on this path | ||
std::process::Command::new("/bin/umount") | ||
.arg(self.mount_path.to_string_lossy().as_ref()) | ||
.stderr(Stdio::null()) | ||
.stdout(Stdio::null()) | ||
.spawn()? | ||
.wait() | ||
.ok(); | ||
|
||
let fs = JournalFileSystemBuilder::new(&self.journal_path) | ||
.with_fd_seed(WasiFdSeed::default()) | ||
.with_progress_bar(false) | ||
.build()?; | ||
|
||
// Mounts the journal file system at a path | ||
fuse::mount(fs, &self.mount_path, &[])?; | ||
Ok(()) | ||
} | ||
} |
Oops, something went wrong.