[RFC] virtio-vsock: Introduce Reader/Writer support#392
Open
luigix25 wants to merge 6 commits into
Open
Conversation
Author
|
TODO:
|
4 tasks
8c08933 to
36d34b8
Compare
Add getter/setter methods directly on PacketHeader. This is preliminary work for new APIs that will be introduced in a following commit. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
247b503 to
15d7372
Compare
Author
TODO:
|
Author
|
mmh not sure why fuzzing is failing. It's untouched. |
Member
Is seemed more infra issue, restarting helped. |
epilys
reviewed
May 20, 2026
Member
epilys
left a comment
There was a problem hiding this comment.
LGTM in general, will need to take another deep look once I have more time
Author
|
[@epilys]
|
Move PacketHeader, Error, Result, and PKT_HEADER_SIZE from the packet module into lib.rs so they can be shared across the crate without circular dependencies. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Add VsockPacketTx and VsockPacketRx in the new packet_rw module. These use virtio_queue's Reader/Writer abstractions instead of raw VolatileSlice, providing a cleaner and safer API for vsock packet handling. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Mark VsockPacket as deprecated in favor of the new VsockPacketTx/VsockPacketRx API introduced earlier. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the PR
Linux can use more than 2 descriptor in a chain for a vsock packet and this crate does not handle it.
To fix it I'm using Reader/Writer helpers from the virtio-queue crate. This needs major (and breaking) changes.
I'm splitting the VsockPacket in Rx and Tx, because in the first one I need writers while in the second Readers.
I had to delete some tests because they no longer apply.
Since this PR involves major changes in the virtio-vsock crate I'd like some general feedback about the new architecture.
Fuzzing has not been modified yet, this is why CI it's failing. It requires massive changes and I'd like to get some feedback around the architecture first.
Fixes: #216
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafecode is properly documented.