[libvirt] Incorrect parameters passed to migrateToURI3
migrateToURI3 does not take 'bandwidth' argument so we shouldn't try to pass it. Actually it results with exception when libvirt>=1.2.17 is used. Note the bandwidth parameter is already in the params list via the call from the libvirt driver in Nova so we don't have to check to see if it's already in 'params'. However, this is ugly and leaks libvirt API info out of the Guest object. That will be refactored and cleaned up in a follow-on change. Closes-Bug: #1589548 Change-Id: Ieea2d955c763655e2b2abfb99fccb1a4c7169794
This commit is contained in:
parent
cfd64c976b
commit
0a6985a93f
|
@ -7438,7 +7438,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
|
|||
False, migrate_data, dom, disk_paths)
|
||||
mock_migrateToURI3.assert_called_once_with(
|
||||
drvr._live_migration_uri('dest'),
|
||||
params=params, flags=0, bandwidth=0)
|
||||
params=params, flags=0)
|
||||
|
||||
def test_live_migration_raises_exception(self):
|
||||
# Confirms recover method is called when exceptions are raised.
|
||||
|
|
|
@ -519,7 +519,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', bandwidth=2, flags=1, params={'p1': 'v1'})
|
||||
'an-uri', flags=1, params={'p1': 'v1'})
|
||||
|
||||
def test_abort_job(self):
|
||||
self.guest.abort_job()
|
||||
|
|
|
@ -522,8 +522,7 @@ class Guest(object):
|
|||
else:
|
||||
if params:
|
||||
self._domain.migrateToURI3(
|
||||
destination, params=params,
|
||||
flags=flags, bandwidth=bandwidth)
|
||||
destination, params=params, flags=flags)
|
||||
else:
|
||||
self._domain.migrateToURI2(
|
||||
destination, dxml=domain_xml,
|
||||
|
|
Loading…
Reference in New Issue