summary refs log tree commit diff
path: root/kvm/tests/dirty_log.rs
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2019-10-22 18:30:36 +0300
committerCommit Bot <commit-bot@chromium.org>2019-12-10 05:16:06 +0000
commitbb30b2f7cf2721b32da71adfa7f7482bfce7b915 (patch)
treee364b4b3d1e605ec1aa7ba032e1d3211cd12ca18 /kvm/tests/dirty_log.rs
parent7434c0002022541f34a929d9a8e3bfaaf4dfc2d9 (diff)
downloadcrosvm-bb30b2f7cf2721b32da71adfa7f7482bfce7b915.tar
crosvm-bb30b2f7cf2721b32da71adfa7f7482bfce7b915.tar.gz
crosvm-bb30b2f7cf2721b32da71adfa7f7482bfce7b915.tar.bz2
crosvm-bb30b2f7cf2721b32da71adfa7f7482bfce7b915.tar.lz
crosvm-bb30b2f7cf2721b32da71adfa7f7482bfce7b915.tar.xz
crosvm-bb30b2f7cf2721b32da71adfa7f7482bfce7b915.tar.zst
crosvm-bb30b2f7cf2721b32da71adfa7f7482bfce7b915.zip
Add runnable vcpu
Add a new type `RunnableVcpu` for a vcpu that is bound to a thread. This
adds type safety to ensure that vcpus are only ever run on one thread
because RunnableVcpu can't `Send`. It also ensures multiple vcpus can't
run on the same thread.

Change-Id: Ia50dc127bc7a4ea4ce3ca99ef1062edbcaa912d0
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1898909
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'kvm/tests/dirty_log.rs')
-rw-r--r--kvm/tests/dirty_log.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/kvm/tests/dirty_log.rs b/kvm/tests/dirty_log.rs
index 527af46..1efe135 100644
--- a/kvm/tests/dirty_log.rs
+++ b/kvm/tests/dirty_log.rs
@@ -52,8 +52,9 @@ fn test_run() {
         )
         .expect("failed to register memory");
 
+    let runnable_vcpu = vcpu.to_runnable(None).unwrap();
     loop {
-        match vcpu.run().expect("run failed") {
+        match runnable_vcpu.run().expect("run failed") {
             VcpuExit::Hlt => break,
             r => panic!("unexpected exit reason: {:?}", r),
         }