<fix>[compute]: add syncVmDeviceInfo when vm is running#3350
<fix>[compute]: add syncVmDeviceInfo when vm is running#3350MatheMatrix wants to merge 1 commit into5.5.6from
Conversation
Walkthrough新增 VmInstanceBase 私有方法 Changes
Sequence Diagram(s)sequenceDiagram
participant VM as VmInstanceBase
participant Bus as CloudBus
participant HostSvc as Host Service
VM->>VM: VM 生命周期事件(start / instantStart / migrate complete / reboot complete)
VM->>VM: syncVmDevicesAddressInfo(vmUuid)
rect rgba(100,150,200,0.5)
VM->>VM: 查询 VM 对象并校验 hostUuid
end
alt 有效 hostUuid
VM->>Bus: 发送 SyncVmDeviceInfoMsg(vmUuid, hostUuid)
Bus->>HostSvc: 转发 SyncVmDeviceInfoMsg
HostSvc->>HostSvc: 处理同步请求
HostSvc-->>Bus: 返回处理结果
Bus-->>VM: 返回响应
VM->>VM: 记录成功日志
else 无 VM 或无 host
VM->>VM: 记录警告/跳过日志
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 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)compute/src/main/java/org/zstack/compute/vm/VmInstanceBase.javaComment |
5cc4241 to
84f6bfb
Compare
|
Comment from ye.zou: 🔴 CRITICAL Code Review Findings经过深入分析,发现1个阻塞性bug和2个高优先级缺陷: ❌ CRITICAL: NullPointerException in PciDeviceManager位置: 问题: 新增的 // KVMHost.java:1541
extEmitter.afterReceiveSyncVmDeviceInfoResponse(
VmInstanceInventory.valueOf(...),
ret,
null // ← spec 是 null
);而 // Line 2563, 2582
.eq(PciDeviceVO_.vmInstanceUuid, spec.getVmInventory().getUuid()) // ← NPE!影响: 每次调用新同步方法都会抛出 NPE,PCI/MDEV 地址信息永远不会被持久化。整个功能失效。 修复方案: 在 String vmUuid = spec != null ? spec.getVmInventory().getUuid() : vm.getUuid();(参考
|
84f6bfb to
f04efb6
Compare
add syncVmDeviceInfo when vm is running Resolves: ZSTAC-67275 Change-Id: I746e63786a677676676b6d6265657063666b7677
f04efb6 to
ace397b
Compare
Resolves: ZSTAC-67275
Change-Id: I746e63786a677676676b6d6265657063666b7677
sync from gitlab !9179