vmm: clear restore snapshot after device creation#157
Merged
tpressure merged 1 commit intoMay 19, 2026
Conversation
ae0ac10 to
3b29e1b
Compare
A restore snapshot is only construction input. The restore path should use it while rebuilding the VM from saved state, then discard it before later VM lifecycle operations run. Keeping it around is observable after a restored VM changes its device set. For example, a VM can be restored from a snapshot, live-migrated, and then hot-remove a device on the destination. The restored device tree no longer contains that device, but DeviceManager still carries the original device snapshot. That stale snapshot can affect later hotplug. Every added device eventually reaches a constructor that calls state_from_id(self.snapshot.as_ref(), id) or an equivalent snapshot lookup. If the stale snapshot still contains an entry with the newly added device name, the new device is created with old saved state even though the matching device was already removed from the live device tree. Clear the DeviceManager snapshot after hypervisor-specific initialization has rebuilt the interrupt controller and devices. From that point onward, device operations should behave as normal runtime operations, not as restore operations. Co-developed-by: Thomas Prescher <thomas.prescher@cyberus-technology.de> Co-developed-by: Leander Kohler <leander.kohler@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
3b29e1b to
21f02f4
Compare
Coffeeri
approved these changes
May 19, 2026
There was a problem hiding this comment.
Great work @tpressure and @phip1611!
Please run the libvirt test pipeline before merging this.
amphi
approved these changes
May 19, 2026
tpressure
approved these changes
May 19, 2026
Member
Author
We both ran the test locally :) a new pipeline is running now including the CH bump: https://gitlab.cyberus-technology.de/cyberus/cloud/libvirt/-/merge_requests/209 |
Member
Author
|
Upstream PR: cloud-hypervisor#8251 |
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.
Different solution to #156. Please see the commit message for more details.
Fixes: https://github.com/cobaltcore-dev/cobaltcore/issues/567