-
Notifications
You must be signed in to change notification settings - Fork 154
inspect: add convenience methods for sending deferred requests #2001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces convenience methods and attributes for sending deferred inspect requests across mesh channels, streamlining the common pattern of manually implementing Inspect
traits for deferred requests. The changes eliminate the need for verbose adhoc
implementations and manual Inspect
trait implementations when sending requests to remote tasks.
Key changes:
- Added
inspect::send
function andsend
attribute for derive macro - Replaced manual
Inspect
implementations with derived versions using the newsend
attribute - Updated various structs across the codebase to use the new convenience methods
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
support/inspect/src/defer.rs | Adds the new send function and AsDeferred struct for deferred inspection |
support/inspect_derive/src/lib.rs | Implements parsing support for the new send attribute in derive macros |
support/inspect/src/lib.rs | Updates documentation to describe the new send attribute |
vmm_core/state_unit/src/lib.rs | Replaces adhoc usage with inspect::send |
vmm_core/src/partition_unit/vp_set.rs | Converts manual Inspect impl to derive with send attribute |
vm/vmcore/src/vmtime.rs | Converts manual InspectMut impl to derive and updates adhoc usage |
vm/devices/vmbus/vmbus_server/src/lib.rs | Converts manual Inspect impl to derive with send attribute |
vm/devices/vmbus/vmbus_relay/src/lib.rs | Converts multiple manual Inspect impls to derive with send attribute |
vm/devices/vmbus/vmbus_client/src/lib.rs | Converts manual Inspect impl to derive with with attribute |
vm/devices/vmbus/vmbus_channel/src/channel.rs | Converts manual Inspect impl to derive with send attribute |
vm/devices/storage/nvme_test/src/workers/coordinator.rs | Converts manual InspectMut impl to derive with send attribute |
vm/devices/storage/nvme/src/workers/coordinator.rs | Converts manual InspectMut impl to derive with send attribute |
vm/devices/storage/disk_nvme/nvme_driver/src/queue_pair.rs | Converts manual Inspect impl to derive with with attribute |
vm/devices/net/mana_driver/src/mana.rs | Converts manual Inspect impl to derive with send attribute |
vm/devices/get/guest_emulation_transport/src/client.rs | Converts manual Inspect impl to derive with send attribute |
support/mesh/mesh_worker/src/worker.rs | Converts manual Inspect impl to derive with send attribute |
support/mesh/mesh_process/src/lib.rs | Converts manual Inspect impl to derive and updates adhoc usage |
vm/vmgs/vmgs_broker/src/client.rs | Converts manual Inspect impl to derive with send attribute |
openvmm/membacking/src/region_manager.rs | Converts manual Inspect impl to derive with with attribute |
openvmm/membacking/src/mapping_manager/manager.rs | Converts manual Inspect impl to derive with with attribute |
openvmm/hvlite_core/src/worker/dispatch.rs | Replaces adhoc usage with inspect::send |
openhcl/underhill_core/src/lib.rs | Updates function call to pass reference instead of clone |
openhcl/underhill_core/src/inspect_internal.rs | Updates function signatures and calls to use references and new send function |
openhcl/underhill_core/src/emuplat/netvsp.rs | Converts manual Inspect impl to derive with send attribute |
openhcl/diag_server/src/diag_service.rs | Replaces adhoc usage with inspect::send |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome stuff, just one weird doc comment thing.
I wonder how few manual Inspect impls are left after this |
Inspect implementations that want to send deferred requests generally must manually implement `Inspect` and/or use `adhoc`. This is not ideal-- this is a common pattern in our codebase, and `adhoc` and manual `Inspect` impls are advanced usage that we want to discourage where possible. Add a new function `inspect::send` and a new attribute `send` that can be used to easily generate the code for sending deferred requests across mesh channels. Use this across the codebase, eliminating a lot of manual `Inspect` impls.
Inspect implementations that want to send deferred requests generally must manually implement
Inspect
and/or useadhoc
. This is not ideal-- this is a common pattern in our codebase, andadhoc
and manualInspect
impls are advanced usage that we want to discourage where possible.Add a new function
inspect::send
and a new attributesend
that can be used to easily generate the code for sending deferred requests across mesh channels. Use this across the codebase, eliminating a lot of manualInspect
impls.