agent: Add more Rust code examples, update TODO check (#28737)
Release Notes: - N/A
This commit is contained in:
parent
d0f806456c
commit
b1e4e6048a
38 changed files with 142 additions and 2 deletions
|
@ -0,0 +1,3 @@
|
|||
url = "https://github.com/firecracker-microvm/firecracker.git"
|
||||
revision = "5eaa6e08e350cd38c8102848913a096312e59097"
|
||||
language_extension = "rs"
|
|
@ -0,0 +1,5 @@
|
|||
1. The changes remove unnecessary generic type parameters from the `FileEngine`, `AsyncFileEngine`, and related structures by directly using the `PendingRequest` type, simplifying type signatures and improving code clarity.
|
||||
2. Error handling is unified through the replacement of `UserDataError` with `RequestError` that specifically carries `PendingRequest` information, ensuring consistent error propagation with request context.
|
||||
3. The `WrappedUserData` struct is renamed to `WrappedRequest` and directly embeds `PendingRequest`, aligning terminology with the virtio block device’s request lifecycle and improving traceability.
|
||||
4. Test code is updated to use `PendingRequest::default()` instead of placeholder `()` types, ensuring type consistency and proper request initialization in all scenarios.
|
||||
5. Code organization is improved by consolidating imports (e.g., merging `IO_URING_NUM_ENTRIES` and `PendingRequest` imports) and removing redundant type parameters across async/sync I/O implementations.
|
|
@ -0,0 +1 @@
|
|||
Refactor the virtio block device’s I/O handling to eliminate generic type parameters from file engine structures, replacing them with the concrete `PendingRequest` type. Update the `AsyncFileEngine` and `FileEngine` implementations to directly handle `PendingRequest` in all operations, ensuring error types like `RequestError` propagate this request context. Rename `UserDataError`/`UserDataOk` to `RequestError`/`RequestOk` and adjust their internals to store `PendingRequest` instead of a generic `user_data`. Simplify imports (e.g., consolidate `io_uring` imports) and modify test code to initialize `PendingRequest` properly with default values where needed. Maintain all existing async/sync I/O functionality, including dirty memory tracking and request completion logic.
|
Loading…
Add table
Add a link
Reference in a new issue