Change in vdsm[master]: virt: migration: rename migration threads
fromani at redhat.com
fromani at redhat.com
Mon Mar 31 15:15:52 UTC 2014
Francesco Romani has uploaded a new change for review.
Change subject: virt: migration: rename migration threads
......................................................................
virt: migration: rename migration threads
drop the now redundant 'Migration' prefix.
No functional or behavioural changes.
Change-Id: I47597b8a0e89d093e0ff725518a80d3ec6de2cfe
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/migration.py
M vdsm/virt/vm.py
2 files changed, 13 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/60/26260/1
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index f8382cf..edb7c4b 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -33,7 +33,7 @@
from . import vmexitreason
-class MigrationSourceThread(threading.Thread):
+class SourceThread(threading.Thread):
"""
A thread that takes care of migration on the source vdsm.
"""
@@ -227,7 +227,7 @@
self._setupVdsConnection()
self._setupRemoteMachineParams()
self._prepareGuest()
- MigrationSourceThread._ongoingMigrations.acquire()
+ SourceThread._ongoingMigrations.acquire()
try:
if self._migrationCanceledEvt:
self._raiseAbortError()
@@ -250,7 +250,7 @@
finally:
if '_migrationParams' in self._vm.conf:
del self._vm.conf['_migrationParams']
- MigrationSourceThread._ongoingMigrations.release()
+ SourceThread._ongoingMigrations.release()
except Exception as e:
self._recover(str(e))
self.log.error("Failed to migrate", exc_info=True)
@@ -293,11 +293,10 @@
self._vm.log.debug('starting migration to %s '
'with miguri %s', duri, muri)
- t = MigrationDowntimeThread(self._vm, int(self._downtime))
+ t = DowntimeThread(self._vm, int(self._downtime))
- if MigrationMonitorThread._MIGRATION_MONITOR_INTERVAL:
- self._monitorThread = MigrationMonitorThread(self._vm,
- startTime)
+ if MonitorThread._MIGRATION_MONITOR_INTERVAL:
+ self._monitorThread = MonitorThread(self._vm, startTime)
self._monitorThread.start()
try:
@@ -327,7 +326,7 @@
finally:
t.cancel()
- if MigrationMonitorThread._MIGRATION_MONITOR_INTERVAL:
+ if MonitorThread._MIGRATION_MONITOR_INTERVAL:
self._monitorThread.stop()
def stop(self):
@@ -341,9 +340,9 @@
raise
-class MigrationDowntimeThread(threading.Thread):
+class DowntimeThread(threading.Thread):
def __init__(self, vm, downtime):
- super(MigrationDowntimeThread, self).__init__()
+ super(DowntimeThread, self).__init__()
self.DOWNTIME_STEPS = config.getint('vars', 'migration_downtime_steps')
self._vm = vm
@@ -377,12 +376,12 @@
self._stop.set()
-class MigrationMonitorThread(threading.Thread):
+class MonitorThread(threading.Thread):
_MIGRATION_MONITOR_INTERVAL = config.getint(
'vars', 'migration_monitor_interval') # seconds
def __init__(self, vm, startTime):
- super(MigrationMonitorThread, self).__init__()
+ super(MonitorThread, self).__init__()
self._stop = threading.Event()
self._vm = vm
self._startTime = startTime
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 73d8836..87788ca 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1576,7 +1576,7 @@
self._lastStatus = vmstatus.RESTORING_STATE
else:
self._lastStatus = vmstatus.WAIT_FOR_LAUNCH
- self._migrationSourceThread = migration.MigrationSourceThread(self)
+ self._migrationSourceThread = migration.SourceThread(self)
self._kvmEnable = self.conf.get('kvmEnable', 'true')
self._guestSocketFile = constants.P_VDSM_RUN + self.conf['vmId'] + \
'.guest.socket'
@@ -2512,7 +2512,7 @@
# taken self Down
if self._lastStatus == vmstatus.DOWN:
return errCode['noVM']
- self._migrationSourceThread = migration.MigrationSourceThread(
+ self._migrationSourceThread = migration.SourceThread(
self, **params)
self._migrationSourceThread.start()
self._migrationSourceThread.getStat()
--
To view, visit http://gerrit.ovirt.org/26260
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I47597b8a0e89d093e0ff725518a80d3ec6de2cfe
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