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

Use a trait for the common Virtq interface #1053

Merged
merged 4 commits into from
Feb 29, 2024

Conversation

cagatay-y
Copy link
Contributor

The initial version simply comments out a method that would be more difficult to adapt, as I wanted to see if the rest works on CI before dealing with it. Should also solve #989 (by removing the need for it).

@mkroening mkroening self-requested a review February 13, 2024 17:01
@mkroening mkroening self-assigned this Feb 13, 2024
@cagatay-y cagatay-y force-pushed the virtqueue-trait branch 2 times, most recently from e6c6219 to 10b7838 Compare February 21, 2024 14:26
Use a trait instead of a wrapper enum to represent the interface
provided by both SplitVq and PackedVq.
The BufferToken attached to VirtqError::WriteTooLarge was not used and
increased the error size from 16 bytes to 184 bytes. The enum was large
also earlier (176 bytes), but the last commit made it exceed clippy's
threshold.
Move method docs to trait definition and remove references to methods that were removed.
@cagatay-y cagatay-y marked this pull request as ready for review February 21, 2024 15:06
prep_buffer and prep_transfer_from_raw are implemented the exact same way for SplitVq and PackedVq. This commit merges them into default implementations inside the trait.
@cagatay-y
Copy link
Contributor Author

a0c1b5a is a bit outside the scope of the PR but I pushed it into this branch rather than making it a separate PR because it depends on the older commits. If preferred, we can merge only the commits before it and I can open it as a separate PR.

@cagatay-y
Copy link
Contributor Author

FYI: git diff --color-moved provides much better output for the last commit.

Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! :)

@mkroening mkroening added this pull request to the merge queue Feb 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 29, 2024
@mkroening mkroening added this pull request to the merge queue Feb 29, 2024
Merged via the queue into hermit-os:main with commit 1d7d019 Feb 29, 2024
13 checks passed
@cagatay-y cagatay-y deleted the virtqueue-trait branch April 4, 2024 10:29
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