summary refs log tree commit diff
path: root/src/argument.rs
diff options
context:
space:
mode:
authorChuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>2019-12-06 10:01:32 +0800
committerCommit Bot <commit-bot@chromium.org>2019-12-09 03:06:47 +0000
commit39087b289a3278bd02d28c1318d3cfb40c94e6db (patch)
tree2ea70f3065d5122326cf345a9b475311669322bf /src/argument.rs
parentd62df4aa6e58c85119077105ebfb81cf6dc617f2 (diff)
downloadcrosvm-39087b289a3278bd02d28c1318d3cfb40c94e6db.tar
crosvm-39087b289a3278bd02d28c1318d3cfb40c94e6db.tar.gz
crosvm-39087b289a3278bd02d28c1318d3cfb40c94e6db.tar.bz2
crosvm-39087b289a3278bd02d28c1318d3cfb40c94e6db.tar.lz
crosvm-39087b289a3278bd02d28c1318d3cfb40c94e6db.tar.xz
crosvm-39087b289a3278bd02d28c1318d3cfb40c94e6db.tar.zst
crosvm-39087b289a3278bd02d28c1318d3cfb40c94e6db.zip
devices: clone the EventFds before activate
The interrupt_evt/interrupt_resample_evt/queue_evts were move to activate
so the reset method has to return them back (although there is no virtio
device implemented the reset method yet).

Instead of move, another way is just clone these EventFds so that they
don't need needed to be returned.

The advantage of doing this can avoid changing every virtio device reset
method (again, currently there is no virtio device implemented the reset
method yet, but this method is going to used when needs to support the
reset of a virtio device) for returning them, which can simplify the code.
And reset method just needs to take care their own specific resources.

The disadvantage is that, the clone of an EventFd is try_clone which might
return error code (although this shouldn't happen). If in such case, the virtio
device won't be activated.

BUG=None
TEST=launch crosvm guest with virtio devices(rng/balloon/blk/net).

Change-Id: I6e55782c3ecc46bfa878aff24b85a58a7ed66365
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1925682
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/argument.rs')
0 files changed, 0 insertions, 0 deletions