mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-28 01:16:50 +00:00
809b1a718c
The vfio code previously managed singleton instances of VfioContainer using thread-local variables hidden inside the implementation of vfio_get_container(). Make the caller hold onto a VfioContainerManager rather than implicitly mutating global state inside a library function in the vfio crate. This also removes the possibility of accidentally creating new VfioContainer instances by calling from a different thread, since the containers were previously thread-local rather than truly global for some reason. This requires threading the vfio_container_manager variable through a few function calls, but this also helps clarify ownership and lifetime of the objects involved. BUG=None TEST=tools/dev_container tools/presubmit Change-Id: I2ba1be561c48143ff14e391c23bad1c6783b73ec Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5601348 Commit-Queue: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Frederick Mayle <fmayle@google.com> Reviewed-by: Pierre-Clément Tosi <ptosi@google.com> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |