Milan Zamazal has uploaded a new change for review.

Change subject: virt: vm: Update time on VM after migration
......................................................................

virt: vm: Update time on VM after migration

When a VM is resumed from suspension and/or migrated, its clock
continues from the time of suspension, i.e. it's delayed.  We already
addressed the problem by introducing VM._syncTime() method.  But for
safety reasons we call the method only in the restoreState path, see
https://gerrit.ovirt.org/48860.

This patch calls _syncTime in migrationDest path as well.  It serves the
originally intended purpose of restoring the clock also after migration,
just separates it from the original solution in case something bad could
happen with migration due to it.

Change-Id: I21ebeecf52bc3f72a2cb7fe9cd9da7b6fd1a86d7
Bug-Url: https://bugzilla.redhat.com/1156194
Signed-off-by: Milan Zamazal <mzama...@redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/49212/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 9aa08bb..7f33c8d 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -2801,10 +2801,6 @@
             fromSnapshot = self.conf.pop('restoreFromSnapshot', False)
             hooks.after_vm_dehibernate(self._dom.XMLDesc(0), self.conf,
                                        {'FROM_SNAPSHOT': fromSnapshot})
-            # TODO: _syncTime() should probably be called for both the
-            # restore_state and migration_dest paths, but let's handle just the
-            # safer case first.
-            self._syncTime()
         elif 'migrationDest' in self.conf:
             if self._needToWaitForMigrationToComplete():
                 usedTimeout = self._waitForUnderlyingMigration()
@@ -2819,6 +2815,8 @@
                 hooks.after_device_migrate_destination(
                     dev._deviceXML, self.conf, dev.custom)
 
+        self._syncTime()
+
         if 'guestIPs' in self.conf:
             del self.conf['guestIPs']
         if 'guestFQDN' in self.conf:


-- 
To view, visit https://gerrit.ovirt.org/49212
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21ebeecf52bc3f72a2cb7fe9cd9da7b6fd1a86d7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzama...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to