-
Notifications
You must be signed in to change notification settings - Fork 105
Remove generic type parameter M
from QueueState
#104
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
Conversation
7536050
to
1038f7b
Compare
Hmm not sure why the coverage drops so much (why it drops at all actually). Will have a look into that. |
fn check_status_desc<M: GuestMemory>(mem: &M, desc: Descriptor) -> Result<()> { | ||
fn check_status_desc<M>(mem: &M, desc: Descriptor) -> Result<()> | ||
where | ||
M: GuestMemory + ?Sized, |
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.
Why special "?Sized" marker here?
Comparing the kcov output between this branch and main, looks like kcov is counting this time all the lines that no longer have the |
so let's update the coverage file:) |
Can't the drop be covered by unit test(s)? 6.9% is pretty much. |
There are no new lines of code, so it seems like an artifact of how |
@alexandruag this change also allows the removal of |
There were new lines of code in this PR that were not covered by unit tests. I wasn't suggesting to add tests in the current PR, but hopefully at some point before publishing the crate. |
The pull request in #111 brings coverage up by 2.5% compared to this one. @alexandruag, if you rebase and fix the coverage I think this can be merged. Thanks! |
I have included rebased patches in #111. |
Any updates about this MR? |
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.
I'll be fine merging this one once its rebased and coverage_config_x86_64.json
is adjusted.
We are using a `: GuestAddressSpace` trait bound for `AvailIter` and `DescriptorChain`, but the objects are actually only interested in the fact that `M` can dereference to a `GuestMemory` implementation. Signed-off-by: Alexandru Agache <aagch@amazon.com>
Signed-off-by: Alexandru Agache <aagch@amazon.com>
There were a couple of changes in rust-vmm#76 that are not yet tested. PR that covers that functionality is in review here: rust-vmm#111. Until that one is merged, the coverage needs to be decreased. Signed-off-by: Laura Loghin <lauralg@amazon.com>
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 @alexandruag and @lauralt
This PR simplifies the
QueueState
abstraction by removing the generic type parameterM
, and also relaxes the trait bounds forAvailIter
andDescriptor
chain to not depend onGuestAddressSpace
anymore, as the logic within is only interested inM
dereferencing to something that implementsGuestMemory
(and not also in the part that it might be one of the associated type of aGuestAddressSpace
implementation).