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

Convert vsock transport to async #325

Merged

Conversation

gaojiaqi7
Copy link
Contributor

  • Change AsyncRead/AsyncWrite trait functions in async_io to async

  • For vsock stream, remove the global vsock device protected by Mutex to avoid dead lock while await and poll another task. All the blocking stream functions are converted to async syntax. Drop method of vsock stream is removed as the shutdown is async but Drop trait is synchronous, caller must call it manually.

  • For pci transport, remove the VsockTransport implementation and replace it with public functions. The device state info are hold by a global instance and the lock is acquired and released in each poll action.

  • For vmcall transport, remove the VsockTransport implementation and replace it with public functions. The context such as mid and cid is saved by vsock stream for each migration request.

@gaojiaqi7 gaojiaqi7 force-pushed the 1202/async_vsock_transport branch from 553eba4 to 2f10b3f Compare December 3, 2024 01:30
@jyao1 jyao1 closed this Dec 5, 2024
@jyao1 jyao1 reopened this Dec 5, 2024
@jyao1 jyao1 closed this Dec 11, 2024
@jyao1 jyao1 reopened this Dec 11, 2024
@gaojiaqi7 gaojiaqi7 force-pushed the 1202/async_vsock_transport branch 2 times, most recently from 3053a5a to c8d1c02 Compare December 11, 2024 02:09
For vsock stream, remove the global vsock device protected by Mutex to
avoid dead lock while await and poll another task. All the blocking
stream functions are converted to async syntax. Drop method of vsock
stream is removed as the shutdown is async but Drop trait is
synchronous.

For pci transport, remove the VsockTransport implementation and replace
it with public functions. The device state info are hold by a global
instance and the lock is acquired and released in each poll action.

For vmcall transport, remove the VsockTransport implementation and
replace it with public functions. The context such as `mid` and `cid` is
saved by vsock stream for each migration request.

Signed-off-by: Jiaqi Gao <[email protected]>
Latest `x86_64` is not compatible with old rust toolchain.

Signed-off-by: Jiaqi Gao <[email protected]>
@gaojiaqi7 gaojiaqi7 force-pushed the 1202/async_vsock_transport branch from c8d1c02 to fea7ed6 Compare December 11, 2024 02:34
@jyao1 jyao1 merged commit 71ff103 into intel:dev/async_multiple_session Dec 11, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants