Fix non-deterministic PCI topology across VM stop/start cycles - #1091
Fix non-deterministic PCI topology across VM stop/start cycles#1091jamepark4 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Refreshes QEMU replacement mappings after Functest VM reboot and snapshot operations.
Changes:
- Exposes the current VM replacement map.
- Refreshes mappings after VM recreation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
lib/setupmanagers/qemuhck/qemuhck.rb |
Exposes VM mappings. |
lib/setupmanagers/functest_client.rb |
Refreshes mappings after reboot/snapshot operations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| end | ||
|
|
||
| def refresh_replacement_map | ||
| @replacement_map = @project.project_replacement_map.merge(@setup_manager.client_vm_replacement_map(@name)) |
This is a bug. We can create wrong network connections too. In this case, the recalculation mask issue. |
I'll try and retool this to address the underlying issue. |
Signed-off-by: jamepark4 <jparker@redhat.com>
547cf91 to
2e4ba18
Compare
PciManagercounters (pci_slot, pci_chassis, pci_addr) were initialized once inQemuMachine.initializebut never reset between runs. When process_device_commands was called on VM restart, the counters continued from where they left off, producing different slot/chassis/addr assignments — and therefore different bus names (e.g., root5 on first boot, root11 on second boot).This caused two problems after clean_boot (stop + restart):
Fix: Extract counter initialization into
PciManager#resetand call it at the start ofprocess_device_commands, matching the existing pattern of resetting@device_commands. This makes PCI allocation deterministic across restarts.