Merge "libvirt: bandwidth param should be set in guest migrate"
This commit is contained in:
@@ -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()
|
||||
|
@@ -6327,7 +6327,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,
|
||||
}
|
||||
|
@@ -640,10 +640,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 parameter is searched in
|
||||
# the `params` dict
|
||||
params['migrate_uri'] = migrate_uri
|
||||
params['bandwidth'] = bandwidth
|
||||
self._domain.migrateToURI3(
|
||||
destination, params=params, flags=flags)
|
||||
else:
|
||||
|
Reference in New Issue
Block a user