-
Notifications
You must be signed in to change notification settings - Fork 156
vmbus: trace logging improvements #2144
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 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 |
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. |
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. |
I don't think anything VMBus logs is private, so at some point we will have to add CVM_ALLOWED to the traces. |
Yeah, there's no harm in doing that sooner rather than later, but no harm in waiting until it's needed either. |
This change improves the logging for
vmbus_server
,vmbus_relay
andvmbus_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.