-
Notifications
You must be signed in to change notification settings - Fork 86
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
Conversation
e6c6219
to
10b7838
Compare
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.
10b7838
to
ecbedf1
Compare
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.
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. |
FYI: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! :)
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).