Skip to content

Conversation

@justus-camp-microsoft
Copy link
Contributor

Currently, we always leak the VFIO device handle even if save fails. While I think we would recover the device on the other end of servicing, we can make it more explicit by doing the same thing we do in shutdown_vtl2_device when the device is in a bad state.

@justus-camp-microsoft justus-camp-microsoft requested a review from a team as a code owner January 27, 2026 18:08
Copilot AI review requested due to automatic review settings January 27, 2026 18:08
Copy link
Contributor

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 fixes a resource leak where the VFIO device handle was unconditionally leaked even when saving the MANA device state failed. The fix ensures that on save failure, the device handle is properly dropped after attempting to reset the device via FLR.

Changes:

  • Conditional leaking of VFIO handle only on successful save operations
  • Explicit device handle drop on save failure after FLR reset attempt
  • Enhanced error logging with structured error information

@github-actions
Copy link

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