From 127453d7eccdb6a903d0855fabb8f0935be90882 Mon Sep 17 00:00:00 2001 From: Zach Reizner Date: Thu, 30 May 2019 18:31:02 -0700 Subject: eliminate mut from non-mut references This manifested itself in a couple places that were turning shared memory buffers into slices for the purposes of passing these slices to `Read` and `Write` trait methods. However, this required the removal of the methods that took `Read` and `Write` instances. This was a convenient interface but impossible to implement safely because making slices from raw pointers without enforcing safety guarantees causes undefined behaviour in Rust. It turns out lots of code in crosvm was using these interfaces indirectly, which explains why this CL touches so much. TEST=crosvm run BUG=chromium:938767 Change-Id: I4ff40c98da6ed08a4a42f4c31f0717f81b1c5863 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1636685 Reviewed-by: Zach Reizner Tested-by: Zach Reizner Tested-by: kokoro Commit-Queue: Zach Reizner --- Cargo.lock | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.lock') diff --git a/Cargo.lock b/Cargo.lock index 44fa861..8446532 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -395,6 +395,7 @@ name = "qcow" version = "0.1.0" dependencies = [ "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "data_model 0.1.0", "libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)", "remain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "sys_util 0.1.0", -- cgit 1.4.1