Conversation
rbradford
force-pushed
the
202603/vhost-user-snapshot-restore
branch
2 times, most recently
from
March 26, 2026 23:01
699eba3 to
ac54f0d
Compare
rbradford
marked this pull request as ready for review
March 26, 2026 23:22
Member
Author
|
Currently only have test cover for virtiofsd (which I know uses the DEVICE_STATE extension). The I've also done a lot of manual testing with virtiofsd and this works well. |
alyssais
reviewed
Mar 27, 2026
Each vhost-user device type had near identical State structs. Deduplicate those by introducing a new common struct (and parameterising it when it needs to embed a config member.) This will make it easier to reuse more code in the future and to add more struct members to handle the requirements of snapshot/restore. These changes have been designed to have no impact on the existing snapshot/restore state. Signed-off-by: Rob Bradford <[email protected]>
With a common state structure for all vhost-user devices the state() methods can also be refactored for reuse. This will make it easier to add new common fields in the future for snapshot/restore. Signed-off-by: Rob Bradford <[email protected]>
In GenericVhostUser's read_config and write_config, access vu_common.acked_protocol_features directly instead of going through the state() method which creates a struct. This removes creating the struct just to access two fields that are already directly accessible. Signed-off-by: Rob Bradford <[email protected]>
This is a refactoring step in preparation for fetching backend device state via SET_DEVICE_STATE_FD which can fail. Signed-off-by: Rob Bradford <[email protected]>
Rename update_supports_migration() to update_supported_features() as this method will be extended to track additional capability flags beyond just migration support (e.g. DEVICE_STATE for snapshot/restore.) Signed-off-by: Rob Bradford <[email protected]>
rbradford
force-pushed
the
202603/vhost-user-snapshot-restore
branch
from
March 27, 2026 10:53
ac54f0d to
bd23c34
Compare
sboeuf
approved these changes
Mar 27, 2026
The vhost-user protocol now has support for the backend to provide an opaque blob of data (read or written through a pipe) that the VMM can use to save/restore state after snapshot/restore or live migration. It also adds a command for checking the backend accepts the uploaded device state. One quirk of saving the state is that GET_VRING_BASE must be used first to quiesce the state of the backend and flush any in-flight requests. This then also requires saving that index for use on the restore. Signed-off-by: Rob Bradford <[email protected]>
Fetch the opaque device state from the backend and store it along with the last vring used in the state used for the snapshot. Signed-off-by: Rob Bradford <[email protected]>
Add a common method for validating the state (checking vrings & device_state) and then restoring the backend state if present. Signed-off-by: Rob Bradford <[email protected]>
Enable the DEVICE_STATE protocol feature negotiation for all vhost-user devices (block, fs, net, and generic). Restoring the state (including the backend state if present) and vrings. Signed-off-by: Rob Bradford <[email protected]>
Add test_snapshot_restore_virtio_fs which validates that virtio-fs continues to work correctly across a snapshot/restore cycle. Signed-off-by: Rob Bradford <[email protected]>
rbradford
force-pushed
the
202603/vhost-user-snapshot-restore
branch
from
March 27, 2026 13:14
bd23c34 to
322fac5
Compare
rbradford
enabled auto-merge
March 27, 2026 13:14
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.
See: #7850