-
Notifications
You must be signed in to change notification settings - Fork 113
Rename GuestMemory->GuestMemoryBackend, IoMemory->GuestMemory #362
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
base: main
Are you sure you want to change the base?
Conversation
The purpose of the function is exactly to change a pointer obtained from a mutable VolatileSlice into a reference, and doing so is unsafe. So just shut up clippy. Signed-off-by: Paolo Bonzini <[email protected]>
Rename GuestMemory to GuestMemoryBackend, IoMemory to GuestMemory. This allows users of vm-memory to be aware of access permissions for memory, with no change to callers that just use the `Bytes` interface. Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
After the rename, the primary interface to vm-memory is almost completely absent in DESIGN.md. Give it more importance and remove some details of GuestMemoryBackend that are now obsolete. Signed-off-by: Paolo Bonzini <[email protected]>
10ec8d3 to
a97d0e1
Compare
Signed-off-by: Paolo Bonzini <[email protected]>
a97d0e1 to
569b637
Compare
|
I'm not sure if this should be 0.18.0 or 0.19.0. @XanClic, I think the current |
| `GuestMemory`; therefore, all callers that just use the `Bytes` interface | ||
| remain completely unchanged. | ||
|
|
||
| - \[[#362](https://github.com/rust-vmm/vm-memory/pull/362)\] Rename `GuestMemory` to `GuestMemoryBackend`, `IoMemory` to `GuestMemoryBackend` |
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.
Typo: IoMemory to GuestMemoryBackendGuestMemory
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.
Also, this hunk should probably be squashed into the prior commit.
| //! - [`GuestMemoryRegion`](trait.GuestMemoryRegion.html): represent a continuous region of guest's | ||
| //! physical memory. | ||
| //! - [`GuestMemory`](trait.GuestMemory.html): represent a collection of `GuestMemoryRegion` | ||
| //! - [`GuestMemoryBackend`](trait.GuestMemory.html): represent a collection of `GuestMemoryRegion` |
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 count seven places like this, where the documentation link isn’t updated – did you leave out the g on the sed? (I know I did (to get a state to compare against) and got the same result at first 😅)
| /// `GuestAddressSpace` provides a way to retrieve a `GuestMemoryBackend` object. | ||
| /// The vm-memory crate already provides trivial implementation for | ||
| /// references to `GuestMemory` or reference-counted `GuestMemory` objects, | ||
| /// references to `GuestMemoryBackend` or reference-counted `GuestMemory` objects, |
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.
(Mainly asking about the g because of this, where the second instance isn’t updated.)
| /// Thanks to the [blanket implementation of `IoMemory` for all `GuestMemory` | ||
| /// types](../io_memory/trait.IoMemory.html#impl-IoMemory-for-M), this blanket implementation | ||
| /// extends to all [`GuestMemory`] types. | ||
| impl<T: IoMemory + ?Sized> Bytes<GuestAddress> for T { | ||
| /// Thanks to the [blanket implementation of `GuestMemory` for all `GuestMemoryBackend` | ||
| /// types](../io_memory/trait.GuestMemory.html#impl-IoMemory-for-M), this blanket implementation | ||
| /// extends to all [`GuestMemoryBackend`] types. | ||
| impl<T: GuestMemory + ?Sized> Bytes<GuestAddress> for T { |
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 think the documentation link should be ../guest_memory/trait.GuestMemory.html#impl-GuestMemory-for-M.
(I think I’m already to blame for the wrong directory, though.)
|
Thanks! 🙂 |
Summary of the PR
As discussed in #327, make the main interface to vm-memory the one that includes permissions and lets fewer aspects of the implementation through.
Based on #361.
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.