Thanks to visit codestin.com
Credit goes to github.com

Skip to content

vmm: Reject removal of an already removed device - #8559

Merged
likebreath merged 1 commit into
cloud-hypervisor:mainfrom
rbradford:202607/net-remove-device
Jul 9, 2026
Merged

likebreath merged 1 commit into
cloud-hypervisor:mainfrom
rbradford:202607/net-remove-device

Conversation

@rbradford

Copy link
Copy Markdown
Member

A hot-unplug leaves the PCI node in the device tree until the guest
acknowledges the ejection, but VmConfig drops the device entry
immediately. A second remove-device therefore still found the node and
tried removing it again. This has no effect on device types other
virtio-net as they silently ignored it but due to the FD handling this
caused a panic for virtio-net devices. For consistency error out when
trying to remove an already removed device for all device types.

Assisted-by: Claude:Opus 4.8
Signed-off-by: Rob Bradford [email protected]

@rbradford
rbradford marked this pull request as ready for review July 8, 2026 18:35
@rbradford
rbradford requested a review from a team as a code owner July 8, 2026 18:35
@rbradford
rbradford marked this pull request as draft July 8, 2026 18:53
@rbradford
rbradford force-pushed the 202607/net-remove-device branch 3 times, most recently from fcfc4c4 to 15de58e Compare July 8, 2026 19:45
A hot-unplug leaves the PCI node in the device tree until the guest
acknowledges the ejection, but VmConfig drops the device entry
immediately.

Move the config removal into DeviceManager::remove_device() and fail
when it returns false, so a second remove-device request cannot reuse
the stale device-tree node.

Assisted-by: OpenAI:Codex-GPT-5
Signed-off-by: Rob Bradford <[email protected]>
@rbradford
rbradford force-pushed the 202607/net-remove-device branch from 15de58e to c50898c Compare July 8, 2026 19:56
@rbradford
rbradford marked this pull request as ready for review July 8, 2026 19:59

@rbradford rbradford left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@likebreath A more minimal version building on the fact remove_device() returned a bool so if it doesn't find the device to remove we can use that as the signal.

@likebreath likebreath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, this is cleaner!

@likebreath
likebreath added this pull request to the merge queue Jul 8, 2026
Merged via the queue into cloud-hypervisor:main with commit 5b53f42 Jul 9, 2026
41 checks passed
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Done in Cloud Hypervisor Roadmap Jul 9, 2026
@rbradford rbradford added the bug-fix Bug fix to include in release notes label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Bug fix to include in release notes

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants