Change in vdsm[master]: migration: unify again performing modes

fromani at redhat.com fromani at redhat.com
Wed Apr 27 12:15:28 UTC 2016


Francesco Romani has uploaded a new change for review.

Change subject: migration: unify again performing modes
......................................................................

migration: unify again performing modes

We recently added two different flows to perform migration monitoring,
the legacy one which uses the DowntimeThread and the new one which
uses the convergence schedule.

Now that we made MonitorThread own the DowntimeThread, we can unify
those flows again, simplifying the code a bit.

Change-Id: Ide226bf735f664a145d4920839005cffd0a50817
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/migration.py
1 file changed, 14 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/56686/1

diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index 9a5ff52..896867c 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -413,10 +413,20 @@
                                                 self._convergence_schedule,
                                                 self._use_convergence_schedule)
 
-            if self._use_convergence_schedule:
-                self._perform_with_conv_schedule(duri, muri)
-            else:
-                self._perform_with_downtime_thread(duri, muri)
+            performing_mode = 'convergence schedule'
+            if not self._use_convergence_schedule:
+                performing_mode = 'downtime thread')
+                self._monitorThread.downtime_thread = DowntimeThread(
+                    self._vm,
+                    int(self._downtime),
+                    config.getint('vars', 'migration_downtime_steps')
+                )
+
+            self._vm.log.debug('performing migration with %s',
+                               performing_mode)
+
+            with utils.running(self._monitorThread):
+                self._perform_migration(duri, muri)
 
             self.log.info("migration took %d seconds to complete",
                           (time.time() - startTime) + destCreationTime)
@@ -457,22 +467,6 @@
             self._vm._dom.migrateToURI3(duri, params, flags)
         else:
             self._raiseAbortError()
-
-    def _perform_with_downtime_thread(self, duri, muri):
-        self._vm.log.debug('performing migration with downtime thread')
-        self._monitorThread.downtime_thread = DowntimeThread(
-            self._vm,
-            int(self._downtime),
-            config.getint('vars', 'migration_downtime_steps')
-        )
-
-        with utils.running(self._monitorThread):
-            self._perform_migration(duri, muri)
-
-    def _perform_with_conv_schedule(self, duri, muri):
-        self._vm.log.debug('performing migration with conv schedule')
-        with utils.running(self._monitorThread):
-            self._perform_migration(duri, muri)
 
     def set_max_bandwidth(self, bandwidth):
         self._vm.log.debug('setting migration max bandwidth to %d', bandwidth)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide226bf735f664a145d4920839005cffd0a50817
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list