Kunalbehbud commented on code in PR #13020:
URL: https://github.com/apache/cloudstack/pull/13020#discussion_r3143614294


##########
engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/KvmFileBasedStorageVmSnapshotStrategy.java:
##########
@@ -204,6 +229,11 @@ public boolean revertVMSnapshot(VMSnapshot vmSnapshot) {
             publishUsageEvent(EventTypes.EVENT_VM_SNAPSHOT_REVERT, 
vmSnapshotBeingReverted, userVm, volumeObjectTo);
         }
 
+        if (isUefiVm(userVm)) {
+            userVm.setLastHostId(hostId);
+            userVmDao.update(userVm.getId(), userVm);
+        }

Review Comment:
   Kept this intentionally. For KVM UEFI guests, the active pflash/NVRAM file 
is host-local. Revert restores the snapshot sidecar into the active NVRAM path 
on the host executing the revert, so lastHostId needs to point to that host for 
the next start to use the restored firmware state. The update is now 
conditional to avoid an unnecessary DB write when it is already the same host.



-- 
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]

Reply via email to