mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-21 02:40:57 +00:00
container: keep the io connection when pass fd to hybrid vsock
We want the io connection keep connected when the containerd closed the io pipe, thus it can be attached on the io stream. Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
This commit is contained in:
parent
4a762fcfdd
commit
cfb262d02f
@ -16,7 +16,9 @@ async fn passfd_connect(uds: &str, port: u32, fd: OwnedFd) -> Result<u32> {
|
|||||||
let mut stream = UnixStream::connect(&uds).await.context("connect")?;
|
let mut stream = UnixStream::connect(&uds).await.context("connect")?;
|
||||||
stream.write_all(b"passfd\n").await.context("write all")?;
|
stream.write_all(b"passfd\n").await.context("write all")?;
|
||||||
|
|
||||||
let buf = format!("{}", port);
|
// We want the io connection keep connected when the containerd closed the io pipe,
|
||||||
|
// thus it can be attached on the io stream.
|
||||||
|
let buf = format!("{} keep", port);
|
||||||
stream
|
stream
|
||||||
.send_with_fd(buf.as_bytes(), &[fd.as_raw_fd()])
|
.send_with_fd(buf.as_bytes(), &[fd.as_raw_fd()])
|
||||||
.context("send port and fd")?;
|
.context("send port and fd")?;
|
||||||
|
Loading…
Reference in New Issue
Block a user