mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-12-26 13:10:56 +00:00
kvm: fix a couple of typos in comments
BUG=None TEST=cargo test --features plugin; cargo test -p kvm Change-Id: If3408984ebb4f9212aaaae6084353a411a7f902b Signed-off-by: Dmitry Torokhov <dtor@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/938845 Reviewed-by: Zach Reizner <zachr@chromium.org>
This commit is contained in:
parent
9786573e07
commit
9c7508593d
1 changed files with 2 additions and 2 deletions
|
@ -863,11 +863,11 @@ impl Vcpu {
|
|||
let vec: Vec<u8> = vec![0; vec_size_bytes];
|
||||
let msrs: &mut kvm_msrs = unsafe {
|
||||
// Converting the vector's memory to a struct is unsafe. Carefully using the read-only
|
||||
// vector to size and set the members ensures no out-of-bounds erros below.
|
||||
// vector to size and set the members ensures no out-of-bounds errors below.
|
||||
&mut *(vec.as_ptr() as *mut kvm_msrs)
|
||||
};
|
||||
unsafe {
|
||||
// Mapping the unsized array to a slice is unsafe becase the length isn't known.
|
||||
// Mapping the unsized array to a slice is unsafe because the length isn't known.
|
||||
// Providing the length used to create the struct guarantees the entire slice is valid.
|
||||
let entries: &mut [kvm_msr_entry] = msrs.entries.as_mut_slice(msr_entries.len());
|
||||
entries.copy_from_slice(&msr_entries);
|
||||
|
|
Loading…
Reference in a new issue