Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
and `GuestRegionMmap::from_range` to be separate from the error type returned by `GuestRegionCollection` functions.
Change return type of `GuestRegionMmap::new` from `Result` to `Option`.
- \[#324](https:////github.com/rust-vmm/vm-memory/pull/324)\] `GuestMemoryRegion::bitmap()` now returns a `BitmapSlice`. Accessing the full bitmap is now possible only if the type of the memory region is know, for example with `MmapRegion::bitmap()`.
- \[[#339](https://github.com/rust-vmm/vm-memory/pull/339)\] Fix `Bytes::read()` and `Bytes::write()` not to ignore `try_access()`'s `count` parameter
Copy link
Member

Choose a reason for hiding this comment

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

This should probably go into a Fixed section. Also, let's specify that this only applies to the blanket impl provided for T: GuestMemory

Copy link
Author

Choose a reason for hiding this comment

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

OK, right!


### Removed

Expand Down
8 changes: 4 additions & 4 deletions src/guest_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ impl<T: GuestMemory + ?Sized> Bytes<GuestAddress> for T {
self.try_access(
buf.len(),
addr,
|offset, _count, caddr, region| -> Result<usize> {
region.write(&buf[offset..], caddr)
|offset, count, caddr, region| -> Result<usize> {
region.write(&buf[offset..(offset + count)], caddr)
},
)
}
Expand All @@ -561,8 +561,8 @@ impl<T: GuestMemory + ?Sized> Bytes<GuestAddress> for T {
self.try_access(
buf.len(),
addr,
|offset, _count, caddr, region| -> Result<usize> {
region.read(&mut buf[offset..], caddr)
|offset, count, caddr, region| -> Result<usize> {
region.read(&mut buf[offset..(offset + count)], caddr)
},
)
}
Expand Down