@@ -521,8 +521,8 @@ pub trait GuestMemory {
521
521
522
522
/// Invokes callback `f` to handle data in the address range `[addr, addr + count)`.
523
523
///
524
- /// /// The address range `[addr, addr + count)` may span more than one
525
- /// [`GuestMemoryRegion`](trait.GuestMemoryRegion.html) objects , or even have holes in it.
524
+ /// The address range `[addr, addr + count)` may span more than one
525
+ /// [`GuestMemoryRegion`](trait.GuestMemoryRegion.html) object , or even have holes in it.
526
526
/// So [`try_access()`](trait.GuestMemory.html#method.try_access) invokes the callback 'f'
527
527
/// for each [`GuestMemoryRegion`](trait.GuestMemoryRegion.html) object involved and returns:
528
528
/// - the error code returned by the callback 'f'
@@ -577,7 +577,7 @@ pub trait GuestMemory {
577
577
/// concurrent accesses to the underlying guest memory.
578
578
///
579
579
/// # Arguments
580
- /// * `guest_addr ` - Guest address to convert.
580
+ /// * `addr ` - Guest address to convert.
581
581
///
582
582
/// # Examples
583
583
///
@@ -640,14 +640,14 @@ impl<T: GuestMemory> Bytes<GuestAddress> for T {
640
640
}
641
641
642
642
/// # Examples
643
- /// * Write a slice at guestaddress 0x200 .
643
+ /// * Write a slice at guestaddress 0x1000 .
644
644
///
645
645
/// ```
646
646
/// # #[cfg(feature = "backend-mmap")]
647
647
/// # use vm_memory::{Bytes, GuestAddress, mmap::GuestMemoryMmap};
648
648
///
649
649
/// # #[cfg(feature = "backend-mmap")]
650
- /// # fn test_write_u64 () {
650
+ /// # fn test_write_slice () {
651
651
/// let start_addr = GuestAddress(0x1000);
652
652
/// let mut gm =
653
653
/// GuestMemoryMmap::from_ranges(&vec![(start_addr, 0x400)])
@@ -657,7 +657,7 @@ impl<T: GuestMemory> Bytes<GuestAddress> for T {
657
657
/// # }
658
658
///
659
659
/// # #[cfg(feature = "backend-mmap")]
660
- /// # test_write_u64 ();
660
+ /// # test_write_slice ();
661
661
/// ```
662
662
fn write_slice ( & self , buf : & [ u8 ] , addr : GuestAddress ) -> Result < ( ) > {
663
663
let res = self . write ( buf, addr) ?;
@@ -671,14 +671,14 @@ impl<T: GuestMemory> Bytes<GuestAddress> for T {
671
671
}
672
672
673
673
/// # Examples
674
- /// * Read a slice of length 16 at guestaddress 0x200 .
674
+ /// * Read a slice of length 16 at guestaddress 0x1000 .
675
675
///
676
676
/// ```
677
677
/// # #[cfg(feature = "backend-mmap")]
678
678
/// # use vm_memory::{Bytes, GuestAddress, mmap::GuestMemoryMmap};
679
679
///
680
680
/// # #[cfg(feature = "backend-mmap")]
681
- /// # fn test_write_u64 () {
681
+ /// # fn test_read_slice () {
682
682
/// let start_addr = GuestAddress(0x1000);
683
683
/// let mut gm =
684
684
/// GuestMemoryMmap::from_ranges(&vec![(start_addr, 0x400)])
@@ -689,7 +689,7 @@ impl<T: GuestMemory> Bytes<GuestAddress> for T {
689
689
/// # }
690
690
///
691
691
/// # #[cfg(feature = "backend-mmap")]
692
- /// # test_write_u64 ()
692
+ /// # test_read_slice ()
693
693
/// ```
694
694
fn read_slice ( & self , buf : & mut [ u8 ] , addr : GuestAddress ) -> Result < ( ) > {
695
695
let res = self . read ( buf, addr) ?;
0 commit comments