summary refs log tree commit diff
path: root/qcow_utils
diff options
context:
space:
mode:
authorFletcher Woodruff <fletcherw@chromium.org>2020-01-22 16:58:28 -0700
committerCommit Bot <commit-bot@chromium.org>2020-01-23 16:23:21 +0000
commit42bff13009bfa0361ad1572997aba5f457cf38f3 (patch)
treea17514da0e0018870672984d5eaa30924c57a804 /qcow_utils
parentf9fc42376a68c17985e2b2d68c077d66f18e3feb (diff)
downloadcrosvm-42bff13009bfa0361ad1572997aba5f457cf38f3.tar
crosvm-42bff13009bfa0361ad1572997aba5f457cf38f3.tar.gz
crosvm-42bff13009bfa0361ad1572997aba5f457cf38f3.tar.bz2
crosvm-42bff13009bfa0361ad1572997aba5f457cf38f3.tar.lz
crosvm-42bff13009bfa0361ad1572997aba5f457cf38f3.tar.xz
crosvm-42bff13009bfa0361ad1572997aba5f457cf38f3.tar.zst
crosvm-42bff13009bfa0361ad1572997aba5f457cf38f3.zip
guest_memory: add fn to get memfd offset of addr
Add a function offset_from_base() which, given a GuestAddress, determines
the offset of that address within the backing memfd of the GuestMemory.

In other words, this lets you convert a GuestAddress into an offset that
can be understood by another process which has mapped the the memfd and
would like to read from that address.

BUG=chromium:968724
TEST=cargo test

Change-Id: I5b033ad29dd38090f74577c068cc62ee9c6effb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2015835
Tested-by: Fletcher Woodruff <fletcherw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Fletcher Woodruff <fletcherw@chromium.org>
Diffstat (limited to 'qcow_utils')
0 files changed, 0 insertions, 0 deletions