mirror of
https://github.com/rust-vmm/vhost-device.git
synced 2025-12-28 16:29:45 +00:00
The I2cAdapterTrait was introduced because of a need to test the i2c implementation without having access to a physical device on the host running the tests. This abstraction though still made the tests pretty hard to write, so it is now replaced by another abstractions: I2cDevice. This abstraction is written working backwards from what we DO NOT have access to on the host where we want to run the tests. This is the i2c device. So, this abstraction is just abstracting the way all the ioctl calls that need to be handled by an i2c device. This way, we can test all the other wrappers that are implemented in this crate. The abstraction is implemented for a physical device to keep backwards compatibility with existing code. This abstraction still needs improvements such as marking the functions as unsafe. For now the tests are commented out because they need to be re-written with this abstraction. Since we still have refactoring work to do (i.e. separate the parsing from the device operation), writing tests is postponed so that it does not involve duplicated work. Signed-off-by: Andreea Florescu <fandree@amazon.com> |
||
|---|---|---|
| .cargo | ||
| .github | ||
| rust-vmm-ci@ae7db2d98a | ||
| src/i2c | ||
| .gitignore | ||
| .gitmodules | ||
| Cargo.toml | ||
| CODEOWNERS | ||
| coverage_config_x86_64.json | ||
| LICENSE-APACHE | ||
| README.md | ||