Merge "libvirt: bandwidth param should be set in guest migrate" into stable/ocata

This commit is contained in:
Zuul 2018-02-19 19:24:02 +00:00 committed by Gerrit Code Review
commit 31a840c2fd
3 changed files with 4 additions and 4 deletions

View File

@ -644,7 +644,7 @@ class GuestTestCase(test.NoDBTestCase):
self.guest.migrate('an-uri', domain_xml='</xml>',
params={'p1': 'v1'}, flags=1, bandwidth=2)
self.domain.migrateToURI3.assert_called_once_with(
'an-uri', flags=1, params={'p1': 'v1'})
'an-uri', flags=1, params={'p1': 'v1', 'bandwidth': 2})
def test_abort_job(self):
self.guest.abort_job()

View File

@ -6232,7 +6232,6 @@ class LibvirtDriver(driver.ComputeDriver):
if self._host.has_min_version(
MIN_LIBVIRT_BLOCK_LM_WITH_VOLUMES_VERSION):
params = {
'bandwidth': CONF.libvirt.live_migration_bandwidth,
'destination_xml': new_xml_str,
'migrate_disks': device_names,
}

View File

@ -641,10 +641,11 @@ class Guest(object):
destination, flags=flags, bandwidth=bandwidth)
else:
if params:
# In migrateToURI3 these parameters are extracted from the
# `params` dict
if migrate_uri:
# In migrateToURI3 this paramenter is searched in
# the `params` dict
params['migrate_uri'] = migrate_uri
params['bandwidth'] = bandwidth
self._domain.migrateToURI3(
destination, params=params, flags=flags)
else: