vmm: Reject removal of an already removed device - #8559
Merged
likebreath merged 1 commit intoJul 9, 2026
Merged
Conversation
rbradford
marked this pull request as ready for review
July 8, 2026 18:35
likebreath
approved these changes
Jul 8, 2026
rbradford
marked this pull request as draft
July 8, 2026 18:53
rbradford
force-pushed
the
202607/net-remove-device
branch
3 times, most recently
from
July 8, 2026 19:45
fcfc4c4 to
15de58e
Compare
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
force-pushed
the
202607/net-remove-device
branch
from
July 8, 2026 19:56
15de58e to
c50898c
Compare
rbradford
marked this pull request as ready for review
July 8, 2026 19:59
rbradford
commented
Jul 8, 2026
rbradford
left a comment
Member
Author
There was a problem hiding this comment.
@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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A hot-unplug leaves the PCI node in the device tree until the guest
acknowledges the ejection, but
VmConfigdrops the device entryimmediately. A second
remove-devicetherefore still found the node andtried 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]