Repository navigation
[DO NOT REVIEW] virtio: test PCI re-save before start and missing queue progress - #5016
Merged
Pedro Henrique Penna (ppenna) merged 1 commit intoNov 10, 2026
Conversation
A restore validates the queues and the device-private state that it restores before it applies them, and an enabled queue of a DRIVER_OK device must carry its progress. It then hands the private state to the stopped device, and a save before the first start returns the restored state: queues that never started keep their restored progress, and the device its restored private state. The MMIO transport had tests of both for an active device. The PCI transport, which restores through the same core, had neither, although microsoft/nvx#1232 requires the restore contract on both transports. Add the PCI counterparts. A restore whose active queue lacks its progress fails before the device sees any state. A restored active device that is stopped and saved before its first start returns the restored queue progress and private state, and starts no queue. The module documentation of the virtio-net saved-state tests still said that an inactive transport defers the device-private state until the device is activated, as the transports did before they restored it into the stopped device. Its test checks that the restore gives the device its state before any queue starts, so say that. Tests: the new tests pass, and fail as their MMIO counterparts do when the restore no longer requires the progress of an active queue, or when a stop before the first start drops the restored progress. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pedro Henrique Penna (ppenna)
requested review from
a team and
Anatol Belski (weltling)
as code owners
November 10, 2026 15:16
Pedro Henrique Penna (ppenna)
merged commit Nov 10, 2026
cd5cd38
into
feature/microvm/dev
73 of 74 checks passed
syeedali
pushed a commit
to syeedali/nvx
that referenced
this pull request
Nov 11, 2026
microsoft#1232 requires the virtio restore contract on both transports: a restore rejects an active queue that lacks its progress before the device sees any state, and a save before the first start returns the restored queue progress and private state. Only the MMIO transport tested either for an active device. Pin cd5cd3814, which microsoft/openvmm#5016 proposes for feature/microvm/dev: one commit on a8a0e3517, the head of that branch. It adds the PCI counterparts of those two tests, and corrects the module documentation of the virtio-net saved-state tests, which still said that an inactive transport defers the device-private state until the device is activated. It changes no product code. The control-session vectors, the source excerpts, the contract versions, and the CPU profiles that nvx-rs copies from OpenVMM match the revision's. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
syeedali
pushed a commit
to syeedali/nvx
that referenced
this pull request
Nov 11, 2026
The NVX pin moves to cd5cd3814, position 246, 115 commits past the mapped tip. Position 246, which microsoft/openvmm#5016 proposes for feature/microvm/dev on its head, a8a0e3517, is unassigned. It adds the PCI counterparts of two MMIO tests of the virtio restore: a restore whose active queue lacks its progress fails before the device sees any state, and a save before the first start returns the restored queue progress and private state. It also corrects the module documentation of the virtio-net saved-state tests, which still described the deferred restore of device-private state. The Scope also says that microsoft/openvmm#5013 merged positions 243-245. Position 246 changes only the test modules of PR13's positions 039 and 048, the first of which positions 213 and 218 also extend. On upstream main, both of its files conflict, since upstream main lacks both test modules, so it follows PR13 upstream. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
syeedali
pushed a commit
to syeedali/nvx
that referenced
this pull request
Nov 11, 2026
Maps NVX's new pin, 61cdd6397, the head of microsoft/openvmm#5022, at position 247, after position 246, cd5cd3814, the head of feature/microvm/dev, which microsoft/openvmm#5016 merged. The pin is 116 commits past the mapped tip. Position 247 is a PR13 fixup. It changes the input gates that PR13's positions 043 and 048 and PR18's position 088 give the console, virtio-net, and virtio-fs with their saved state: each device's reset cleared its gate, and now keeps it. It states that rule on the gate's methods of VirtioDevice and ChangeDeviceState, which PR13's position 040 and PR09's position 018 add, extends the snapshot guide's paragraph on the post-restore gate that PR20's position 095 adds, and adds tests beside those of the devices, which extend the broker's test harness of PR23's position 113 and the gated-queue tests of position 172. It folds into positions 043 and 048, its virtio-fs change into PR18's position 088, and its other parts into the positions that add what they change, as the fold sentences after the DAG and the commit mapping say; the Scope, the DAG, the dependency graph, the PR summary, and the commit mapping record it with PR13. Replaying it on upstream main conflicts in 13 of its 15 files, all but a new module of console tests and the development dependency that virtio-fs takes for its transport tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Tests the virtio restore contract on the PCI transport as on the MMIO transport, for microsoft/nvx#1232. A restore validates the queues and the device-private state that it restores before it applies them, and requires the progress of every enabled queue of a
DRIVER_OKdevice; it then hands the private state to the stopped device, and a save before the first start returns the restored state. Only the MMIO transport tested either for an active device, although microsoft/nvx#1232 requires the restore contract on both transports.One commit on
a8a0e3517, the head offeature/microvm/dev. microsoft/nvx#1451 pins this head.Test PCI re-save before start and missing queue progress (
cd5cd3814)mmio_restore_rejects_missing_active_queue_progressandmmio_resave_before_first_start_keeps_restored_statehad no PCI counterparts. The PCI transport restores through the same core (restore_commonandrestore_device_state), but its own save, restore, and stop around that core, which restore its config space first, were untested on both points for an active device.pci_restore_rejects_missing_active_queue_progress: the saved state of an active PCI device whose enabled queue lacks its progress fails the restore with the core'smissing progress stateerror, before the device sees any state, and no queue starts.pci_resave_before_first_start_keeps_restored_state: a restored active PCI device that is stopped and saved before its first start returns the restored queue progress and private state, and starts no queue. The module documentation of the virtio-net saved-state tests no longer says that an inactive transport defers the device-private state until the device is activated, which the transports stopped doing when they began to restore it into the stopped device: itsinactive_transport_restore_applies_net_private_statechecks that the restore gives the device its state before any queue starts.validate_restored_stateno longer requires the progress of an enabled queue of aDRIVER_OKdevice, or whencapture_stopdrops the restored progress of a queue that never started.Validation
cargo check,cargo clippy --all-targets,cargo doc --no-deps(RUSTDOCFLAGS=-D warnings), andcargo nextest run --profile agentfor-p virtio -p virtio_net, 226 passed and 1 skipped, without warnings;cargo xtask fmt --fixchanged nothing.cargo nextest run --profile agent -p virtio -p virtio_net, 226 passed and 1 skipped; at the base, neither PCI test exists.