netvsp & mana_driver - Improve failure identification & improve cleanup#3146
netvsp & mana_driver - Improve failure identification & improve cleanup#3146ben-zen wants to merge 2 commits intomicrosoft:mainfrom
Conversation
b45d0bc to
55bffa1
Compare
There was a problem hiding this comment.
Pull request overview
Improves diagnosability of rare shutdown/save failures in the MANA VF driver by adding explicit panic messages when Arc::into_inner() fails, and ensures netvsp drops packet-capture controls during endpoint teardown to help release retained vport references.
Changes:
- Replace
unwrap()withexpect()forArc::into_inner(self.inner)inManaDevice::{save,shutdown}to provide clearer failure identification. - Clear
pkt_capture_controlsafter disconnecting endpoints to force-drop any retained packet capture controls during teardown.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| vm/devices/net/mana_driver/src/mana.rs | Adds clearer expect() messages when unwrapping the device inner Arc during save/shutdown. |
| openhcl/underhill_core/src/emuplat/netvsp.rs | Ensures packet capture controls are dropped after endpoint disconnect to help release retained vport references. |
|
We discussed in the team that it's odd that If that's seen as worthwhile, I plan to bring it as a separate patch as this is a targeted set of changes that are worthwhile in of themselves. |
Arc::<T>::into_inner()returnsSome(T)orNone, and a call tounwrap()that returned result will panic with no clear error message; in cases where all clones of anArcwill eventually haveinto_inner()called on them, the resource will eventually be de-reference-counted and ultimately released, but the clones ofManaDevice::innerare stored inVports which need to be cleaned up before one of the expected terminal states of theManaDeviceis reached.This change replaces
.unwrap()with.expect()on both calls to extractManaDevice::innerfrom its Arc, and adds a cleanup step to force the release of netvsp's retainedVportinstances.