libvirt: remove pointless loop after live migration finishes

The libvirt 'migrateToURI' API(s) all block the caller until the
live migration operation has completed. As such, the timer call
used to check if live migration has completed is entirely pointless.
It appears this is code left over from the very first impl of live
migration in Nova, when Nova would simply shell out to the 'virsh'
command instead of using the libvirt APIs. Even back then though
it looks like it was redundant, since the command being spawned
would also block until live migration was finished.

Conflicts:
	nova/virt/libvirt/driver.py

Related-bug: #1414065
Change-Id: Ib3906ef8564a986f7c0e980774e4ed76b3f93a38
(cherry-pick from commit 584a44f015)
This commit is contained in:
Daniel P. Berrange 2015-01-28 17:46:55 +00:00 committed by Billy Olsen
parent 65cddb0c1a
commit 6833176b56
1 changed files with 2 additions and 14 deletions

View File

@ -5434,20 +5434,8 @@ class LibvirtDriver(driver.ComputeDriver):
instance=instance)
recover_method(context, instance, dest, block_migration)
# Waiting for completion of live_migration.
timer = loopingcall.FixedIntervalLoopingCall(f=None)
def wait_for_live_migration():
"""waiting for live migration completion."""
try:
self.get_info(instance)['state']
except exception.InstanceNotFound:
timer.stop()
post_method(context, instance, dest, block_migration,
migrate_data)
timer.f = wait_for_live_migration
timer.start(interval=0.5).wait()
post_method(context, instance, dest, block_migration,
migrate_data)
def _fetch_instance_kernel_ramdisk(self, context, instance):
"""Download kernel and ramdisk for instance in instance directory."""