crosvm/disk
Daniel Verkamp 482874c248 disk: qcow: fix unit test build on 32-bit platforms
The previous disk size (0x1_0000_0000 = 4 GiB) would overflow usize on
32-bit platforms, causing a unit test build failure.  Shrink it to half
the size, which is still plenty for the purposes of the tests.

Seek offsets are natively 64 bits wide, even on 32-bit platforms,
whereas usize can be only 32 bits wide, so rearrange the casts such that
the final seek offset and intermediate values used to calculate it are
stored in u64 instead of usize.

BUG=chromium:1112839
TEST=cargo test -p disk
TEST=FEATURES=test emerge-kevin crosvm

Change-Id: Ia25762541104124960d9298e6ad7e56f71aa3031
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2347076
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2020-08-18 05:30:36 +00:00
..
src disk: qcow: fix unit test build on 32-bit platforms 2020-08-18 05:30:36 +00:00
Cargo.toml Add "base" crate and transition crosvm usages to it from sys_util 2020-08-06 18:19:44 +00:00