summary refs log tree commit diff
path: root/kvm_sys
diff options
context:
space:
mode:
authorMatt Delco <delco@chromium.org>2020-01-21 15:01:50 -0800
committerCommit Bot <commit-bot@chromium.org>2020-02-19 23:05:34 +0000
commitce03437d567717bcee61ff464bc45f0a98dd3eb9 (patch)
treed091f3b4ee87c962f10035ad0cbebd087c2f8409 /kvm_sys
parentc24ad78624c7f15abeabf05f621c6acd050efc4b (diff)
downloadcrosvm-ce03437d567717bcee61ff464bc45f0a98dd3eb9.tar
crosvm-ce03437d567717bcee61ff464bc45f0a98dd3eb9.tar.gz
crosvm-ce03437d567717bcee61ff464bc45f0a98dd3eb9.tar.bz2
crosvm-ce03437d567717bcee61ff464bc45f0a98dd3eb9.tar.lz
crosvm-ce03437d567717bcee61ff464bc45f0a98dd3eb9.tar.xz
crosvm-ce03437d567717bcee61ff464bc45f0a98dd3eb9.tar.zst
crosvm-ce03437d567717bcee61ff464bc45f0a98dd3eb9.zip
tests: avoid internal error in pause test
When running plugin tests it's not uncommon to see:

vcpu 0 has internal error

Though the tests don't actually fail on this problem. This seems
to occur as a side effect of the plugin_vcpu_pause.c calling
crosvm_destory_memory() before the test VM has actually finished
running.

The main thread will call read() on the 'kill' eventfd 5 times for:
init, pause, unpause, unpause, kill

The vcpu thread will call write() on the eventfd up to 8 times:

init, pause #1, unpause #1, pause #2, unpause #2, pause #3,
unpause #3, kill

The main thread's third pause request might occur before the second
pause request has been processed, in which case the vcpu thread will
only be paused twice (thus there will only be 6 calls to write()).
Given the unpredictable # of events I've opted to split the
init/pause/unpause events to a separate eventfd and keep the 'kill'
eventfd solely for its intended purpose.

BUG=None
TEST=ran ./build_test several times and observed no failures in the
pause plugin test.

Change-Id: Ie0817a4419ae6199fcc5c53496360b2bd81556e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2012788
Reviewed-by: Matt Delco <delco@chromium.org>
Commit-Queue: Matt Delco <delco@chromium.org>
Tested-by: Matt Delco <delco@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'kvm_sys')
0 files changed, 0 insertions, 0 deletions