-
Notifications
You must be signed in to change notification settings - Fork 177
migrate_options_shared:fix removing vm #6585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Dan Zheng <[email protected]>
WalkthroughThe config adds new xbzrle-with-parallel variants in both positive and negative multifd/customized_connection paths and removes a prior default_connection xbzrle variant. The Python test flow now gates “migrate back” logic behind a new status_error flag, skipping migration-back steps when status_error is enabled. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant T as Test Runner
participant S as migrate_options_shared.py
participant Src as Source Host
participant Dst as Destination Host
rect rgba(230,240,255,0.5)
note over S: Setup & parameter parsing
T->>S: Run migration test
S->>S: status_error = (params["status_error"] == "yes")
end
rect rgba(240,255,240,0.5)
S->>Src: Start migration to Dst
Src-->>Dst: VM state transfer (multifd/customized)
S->>S: do_actions_after_migrate()
end
alt status_error == no and migrate_vm_back == yes
note over S: Post-migration checks and prepare migrate-back
S->>Dst: Pre-check/setup for migrate back
Dst-->>Src: Migrate VM back
else status_error == yes
note over S: Migration-back path skipped
end
rect rgba(255,245,230,0.5)
note over S: Cleanup
alt status_error == no and migrate_vm_back == yes
S->>Src: Remove pre-migration setup
else
note right of S: Skip migrate-back cleanup
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
Before fix:
After fix:
libvirt-11.5.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
libvirt/tests/cfg/migration/migrate_options_shared.cfg (2)
521-524
: Make err_msg resilient across libvirt versions.The exact wording can vary slightly by version. Prefer a regex/substring that tolerates punctuation/wording differences.
- err_msg = "Compression method 'xbzrle' isn't supported with parallel migration" + # Accept minor wording/punctuation differences across versions + err_msg = "(?i)Compression method ['\"]?xbzrle['\"]? (isn'?t|is not) supported (with|for) (parallel|multifd) migration"
513-516
: Typo in variant name.Rename “inavalid_connect_num” → “invalid_connect_num” for clarity.
- - inavalid_connect_num: + - invalid_connect_num:libvirt/tests/src/migration/migrate_options_shared.py (1)
1605-1607
: Good fix: skip migrate-back on status_error; avoid shadowing earlier status_error.Re-reading status_error is correct, but reuse of the same variable name can confuse given the earlier assignment (Line 1055). Use a new name and reference it in both places.
- status_error = params.get("status_error", "no") == "yes" - if migrate_vm_back and not status_error: + status_error_effective = params.get("status_error", "no") == "yes" + if migrate_vm_back and not status_error_effective: @@ - if migrate_vm_back and not status_error: + if migrate_vm_back and not status_error_effective:Also applies to: 1678-1678
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
libvirt/tests/cfg/migration/migrate_options_shared.cfg
(1 hunks)libvirt/tests/src/migration/migrate_options_shared.py
(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
libvirt/tests/src/migration/migrate_options_shared.py (1)
libvirt/tests/src/virsh_cmd/domain/virsh_attach_device.py (1)
status_error
(81-83)
Summary by CodeRabbit