sureshanaparti commented on code in PR #12617:
URL: https://github.com/apache/cloudstack/pull/12617#discussion_r3154370244
##########
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java:
##########
@@ -3359,6 +3392,27 @@ private void updateVmPod(VMInstanceVO vm, long
dstHostId) {
_vmDao.persist(newVm);
}
+ /**
+ * Updates CLVM_LOCK_HOST_ID for all CLVM volumes attached to a VM after
VM migration.
+ * This ensures that subsequent operations on CLVM volumes are routed to
the correct host.
+ *
+ * @param vmId The ID of the VM that was migrated
+ * @param destHostId The destination host ID where the VM now resides
+ */
+ private void updateClvmLockHostForVmVolumes(long vmId, long destHostId) {
+ List<VolumeVO> volumes = _volsDao.findByInstance(vmId);
+ if (volumes == null || volumes.isEmpty()) {
Review Comment:
```suggestion
if (CollectionUtils.isEmpty(volumes)) {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]