<fix>[kvm]: fix Hygon_Customized CPU mode migration failure#3338
<fix>[kvm]: fix Hygon_Customized CPU mode migration failure#3338ZStack-Robot wants to merge 2 commits into5.5.6from
Conversation
When VM CPU mode is set to Hygon_Customized and live migration is performed, the migration fails because Hygon_Customized was being treated as a custom CPU model name rather than being converted to host-passthrough mode. This fix adds CPU_MODE_HYGON_CUSTOMIZED to the condition check and converts it to host-passthrough during VM start, preventing CPU feature mismatch errors during migration on Hygon CPU clusters. Resolves: ZSTAC-73095 Change-Id: Ic418091f1c466624ae7f9ee0b0f466092dde1b54
概览本次提交扩展了KVM主机的虚拟机启动CPU模式处理逻辑,增加了对HYGON_CUSTOMIZED CPU模式的支持,并将其映射为HOST_PASSTHROUGH用于嵌套虚拟化配置。 变更列表
代码审查工作量🎯 2 (简单) | ⏱️ ~8 分钟 诗歌
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.40.5)plugin/kvm/src/main/java/org/zstack/kvm/KVMHost.javaComment |
概览在 KVMHost.startVm 方法中扩展了嵌套虚拟化处理逻辑,现支持 CPU_MODE_HYGON_CUSTOMIZED 模式。当模式为 HYGON_CUSTOMIZED 时,将其映射至 HOST_PASSTHROUGH,以避免 CPU 型号不匹配。其余分支保持不变。 变更
代码审查工作量评估🎯 2 (简单) | ⏱️ ~12 分钟 诗
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.40.5)plugin/kvm/src/main/java/org/zstack/kvm/KVMHost.javaComment |
Resolves: ZSTAC-73095 Change-Id: I6c2209ddfc8febd8f5644c031b96428b646bd692
Summary
Hygon_Customizedfails live migration with CPU feature mismatchKVMHost.java:4472did not recognizeCPU_MODE_HYGON_CUSTOMIZEDas a special passthrough mode, treating it as a custom CPU model name. This caused invalid libvirt XML<cpu mode="custom"><model>Hygon_Customized</model></cpu>, which is not a valid libvirt CPU model.CPU_MODE_HYGON_CUSTOMIZEDto the condition check and convert it tohost-passthroughwhen building StartVmCmd. Aligns with existing conversion logic inVmCpuVendorKvmStartVmExtension.java:65-89.Changes
plugin/kvm/src/main/java/org/zstack/kvm/KVMHost.java: Added Hygon_Customized to host-passthrough conversion check (3 lines changed)Test Plan
Resolves: ZSTAC-73095
sync from gitlab !9167