Skip to content

Conversation

jstarks
Copy link
Member

@jstarks jstarks commented Sep 12, 2025

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.

@Copilot Copilot AI review requested due to automatic review settings September 12, 2025 19:16
@jstarks jstarks requested review from a team as code owners September 12, 2025 19:16
Copy link
Contributor

@Copilot Copilot AI left a 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 and send attribute for derive macro
  • Replaced manual Inspect implementations with derived versions using the new send 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

Copy link
Member

@chris-oo chris-oo left a 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.

@smalis-msft
Copy link
Contributor

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.
smalis-msft
smalis-msft previously approved these changes Oct 7, 2025
Copy link

github-actions bot commented Oct 7, 2025

@smalis-msft smalis-msft enabled auto-merge (squash) October 9, 2025 03:05
@smalis-msft smalis-msft merged commit 6d2f901 into microsoft:main Oct 9, 2025
50 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants