mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-10-23 04:46:29 +00:00
12dead57f2
For large overlay files, sometimes it is not neccessary to apply the entire overlay, and only a few nodes must be applied instead. For example, a large overlay file may contain nodes for all devices that can be assigned to a VM via VFIO. However, in most cases only a small subset of devices will actually be assigned, so only a small subset of the FDT overlay must be applied. This change implements device tree overlay filtering. Ie, it allows the API user to choose which overlay nodes will be applied to the base. It is possible to pass a set of symbols (node labels) to `apply_overlay` function, which act as a filter for the device tree nodes. This requires defining node labels (symbols) in DT source and compiling DT overlays (`-@` option in dtc), so that the node symbols are exported in `__symbols__` node. Bug: b/296796644 Test: cd cros_fdt && cargo test Change-Id: I2238cf08b85e1825f668f83d8edadd2446a28869 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4855967 Commit-Queue: Jakob Vukalović <jakobvukalovic@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
848 B
848 B