summary refs log tree commit diff
path: root/devices/src/virtio/virtio_pci_device.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/virtio_pci_device.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/virtio_pci_device.rs')
-rw-r--r--devices/src/virtio/virtio_pci_device.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/devices/src/virtio/virtio_pci_device.rs b/devices/src/virtio/virtio_pci_device.rs
index 2563c8f..4b161d4 100644
--- a/devices/src/virtio/virtio_pci_device.rs
+++ b/devices/src/virtio/virtio_pci_device.rs
@@ -703,4 +703,8 @@ impl PciDevice for VirtioPciDevice {
             self.common_config.queue_select = 0;
         }
     }
+
+    fn on_device_sandboxed(&mut self) {
+        self.device.on_device_sandboxed();
+    }
 }