Skip to content

Conversation

SvenGroot
Copy link
Member

This change improves the logging for vmbus_server, vmbus_relay and vmbus_client. It adds the full offer key (interface guid, instance guid, and subchannel index) to all messages where it is available, making log messages for a particular channel easier to correlate.

It also adds some additional (mostly debug level) logs for the guest closing a channel, releasing a channel, and some hvsocket events.

@Copilot Copilot AI review requested due to automatic review settings October 10, 2025 21:18
@SvenGroot SvenGroot requested review from a team as code owners October 10, 2025 21:18
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 improves tracing and logging across the VMBus components by adding comprehensive offer key information (interface GUID, instance GUID, and subchannel index) to log messages, making it easier to correlate logs for specific channels. It also adds debug-level logging for channel lifecycle events and HvSocket operations.

  • Adds offer key (key = %channel.key) to existing log messages throughout vmbus_server, vmbus_relay, and vmbus_client
  • Introduces new debug logging for channel closing, HvSocket connection events, and client channel releases
  • Enhances error handling with better logging context for HvSocket relay operations

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vm/devices/vmbus/vmbus_server/src/lib.rs Adds offer key context to channel revocation, closing, and error logs; adds debug logging for HvSocket events
vm/devices/vmbus/vmbus_server/src/hvsock.rs Enhances HvSocket relay logging with service IDs and connection status
vm/devices/vmbus/vmbus_server/src/channels.rs Adds offer key to channel operation logs, GPADL operations, and error messages
vm/devices/vmbus/vmbus_relay/src/lib.rs Adds offer key context to relay channel operations and error handling
vm/devices/vmbus/vmbus_client/src/lib.rs Adds offer key to client-side channel operations and lifecycle events
vm/devices/vmbus/vmbus_channel/src/bus.rs Adds Default and Inspect traits to OfferKey; implements From trait for OfferChannel conversion

@benhillis
Copy link
Member

Asking because I don't know the answer. In other PR's I see tracelogging statements that have a CVM_ALLOWED enum. I assume that events that do not have this type are not logged in a CVM context. Would we want this logging from CVM? I don't think most / all of them are logging anything private about the guest.

@smalis-msft
Copy link
Contributor

Today we only prevent the logging of events tagged CVM_CONFIDENTIAL; untagged events and those marked CVM_ALLOWED are logged. At some point in the future we will move untagged events to not be logged.

@SvenGroot
Copy link
Member Author

I don't think anything VMBus logs is private, so at some point we will have to add CVM_ALLOWED to the traces.

@smalis-msft
Copy link
Contributor

Yeah, there's no harm in doing that sooner rather than later, but no harm in waiting until it's needed either.

@SvenGroot SvenGroot merged commit c50831e into microsoft:main Oct 13, 2025
29 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