Remove vm-memory dependency and DeviceIo changing - #18
Conversation
| pub trait DeviceIo: Send { | ||
| /// Read from the guest physical address `addr` to `data`. | ||
| fn read(&mut self, addr: IoAddress, data: &mut [u8]); | ||
| /// Read from guest physical address `base + offset` of the registered |
There was a problem hiding this comment.
nit: We can write this as: "Read from the guest physical address base starting at offset. Result is placed in data." and then we don't need to specify what each argument is doing as it is more clear from the text. Same re-phrasing would be needed for write.
Unrelated to this change, but can someone remind me again why we don't return data? Having return values in function parameters is a bit of an anti-pattern.
There was a problem hiding this comment.
Unrelated to this change, but can someone remind me again why we don't return
data? Having return values in function parameters is a bit of an anti-pattern.
It's more efficient, as it allows for a zero copy from the device into the KVM run IO/MMIO data structure.
Use u64 for guest memory address type since this can make vm-device independent from on vm-memory. Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
Change DeviceIo interface parameters to base and offset, so that devices with several IO ranges can use it to locate right range. Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
As suggested from rust-vmm#18 (comment) Suggested-by: Andreea Florescu <fandree@amazon.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
As suggested from #18 (comment) Suggested-by: Andreea Florescu <fandree@amazon.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
No description provided.