Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug,channel receiver in debug is blocked by self io #137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions vmm/task/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ pub async fn debug_console(stream: VsockStream) -> Result<()> {
let (mut stream_reader, mut stream_writer) = stream.split();
let pty_fd = RawStream::new(pty_master)
.map_err(io_error!(e, "failed to create AsyncDirectFd from rawfd"))?;
tokio::spawn(async move {
if let Some(id) = child.id() {
let exit_status = wait_pid(id as i32, s).await;
debug!("debug console shell exit with {}", exit_status)
}
});
tokio::spawn(async move {
let (mut pty_reader, mut pty_writer) = tokio::io::split(pty_fd);
tokio::select! {
Expand All @@ -73,10 +79,6 @@ pub async fn debug_console(stream: VsockStream) -> Result<()> {
debug!("stream closed: {:?}", res);
}
}
if let Some(id) = child.id() {
let exit_status = wait_pid(id as i32, s).await;
debug!("debug console shell exit with {}", exit_status)
}
});

Ok(())
Expand Down