summary refs log tree commit diff
path: root/devices/src/virtio/vhost/worker.rs
diff options
context:
space:
mode:
authorChuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>2019-11-04 19:11:56 +0800
committerCommit Bot <commit-bot@chromium.org>2020-01-19 09:24:42 +0000
commit1375c284b7adce6b19b4b2fe0c4b9ad7e5e987a6 (patch)
tree2f907d8df244ba56e10ef4420b5d0a50dc7d541c /devices/src/virtio/vhost/worker.rs
parent92ee1489ce4fb011f8a55fa7d2e8e3cb4ff75dab (diff)
downloadcrosvm-1375c284b7adce6b19b4b2fe0c4b9ad7e5e987a6.tar
crosvm-1375c284b7adce6b19b4b2fe0c4b9ad7e5e987a6.tar.gz
crosvm-1375c284b7adce6b19b4b2fe0c4b9ad7e5e987a6.tar.bz2
crosvm-1375c284b7adce6b19b4b2fe0c4b9ad7e5e987a6.tar.lz
crosvm-1375c284b7adce6b19b4b2fe0c4b9ad7e5e987a6.tar.xz
crosvm-1375c284b7adce6b19b4b2fe0c4b9ad7e5e987a6.tar.zst
crosvm-1375c284b7adce6b19b4b2fe0c4b9ad7e5e987a6.zip
vhost: impl on_device_sandboxed for virtio device
vhost set_owner fn only needs to be called once. Put it in activate
fn will block the vhost devices to be activated again in future.
on_device_sandboxed is a good place to put the set_owner as it only
run once. So put it there.

BUG=None
TEST=launch Crosvm guest with vhost-net and vsock. Both of them can work
TEST=cargo test -p devices

Change-Id: I45308e26b026c9141e4426d8b1bbe1944612a915
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1954173
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'devices/src/virtio/vhost/worker.rs')
-rw-r--r--devices/src/virtio/vhost/worker.rs5
1 files changed, 0 insertions, 5 deletions
diff --git a/devices/src/virtio/vhost/worker.rs b/devices/src/virtio/vhost/worker.rs
index 17114a4..9450929 100644
--- a/devices/src/virtio/vhost/worker.rs
+++ b/devices/src/virtio/vhost/worker.rs
@@ -51,11 +51,6 @@ impl<T: Vhost> Worker<T> {
         F1: FnOnce(&T) -> Result<()>,
         F2: FnOnce(&T) -> Result<()>,
     {
-        // Preliminary setup for vhost net.
-        self.vhost_handle
-            .set_owner()
-            .map_err(Error::VhostSetOwner)?;
-
         let avail_features = self
             .vhost_handle
             .get_features()