summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmando Migliaccio <amigliaccio@internap.com>2013-02-07 18:45:46 +0000
committerArmando Migliaccio <amigliaccio@internap.com>2013-02-09 11:55:54 +0000
commit70c6882763116ef6515090f136fc0769698a6816 (patch)
tree7bc32c441ebcad7f5f5a5aa66dfee656f8b1cfdc
parentd2dad24e0a094827cc4c4e855a7ae43c4c08ce44 (diff)
Return dest_check_data as expected by the Scheduler
the scheduler driver expects data in return when calling compute_rcp.check_can_live_migrate_destination in method 'schedule_live_migration'. In turn check_can_live_migrate_destination calls check_can_live_migrate_source that also expects data returned from the driver. Fixes bug #1118491 Change-Id: I3dbfa716d5d9bc849c1f67005e7bb1b8ba1ccd30
-rw-r--r--nova/tests/test_xenapi.py7
-rw-r--r--nova/virt/xenapi/driver.py4
-rw-r--r--nova/virt/xenapi/vmops.py1
3 files changed, 7 insertions, 5 deletions
diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py
index c480d5c5f..0f45e89bb 100644
--- a/nova/tests/test_xenapi.py
+++ b/nova/tests/test_xenapi.py
@@ -2676,9 +2676,10 @@ class XenAPILiveMigrateTestCase(stubs.XenAPITestBase):
'destination_sr_ref': None,
'migrate_send_data': None
}}
- self.conn.check_can_live_migrate_source(self.context,
- {'host': 'host'},
- dest_check_data)
+ result = self.conn.check_can_live_migrate_source(self.context,
+ {'host': 'host'},
+ dest_check_data)
+ self.assertEqual(dest_check_data, result)
def test_check_can_live_migrate_source_with_block_migrate_fails(self):
stubs.stubout_session(self.stubs,
diff --git a/nova/virt/xenapi/driver.py b/nova/virt/xenapi/driver.py
index 46b759f43..071d30864 100644
--- a/nova/virt/xenapi/driver.py
+++ b/nova/virt/xenapi/driver.py
@@ -452,8 +452,8 @@ class XenAPIDriver(driver.ComputeDriver):
:param dest_check_data: result of check_can_live_migrate_destination
includes the block_migration flag
"""
- self._vmops.check_can_live_migrate_source(ctxt, instance_ref,
- dest_check_data)
+ return self._vmops.check_can_live_migrate_source(ctxt, instance_ref,
+ dest_check_data)
def get_instance_disk_info(self, instance_name):
"""Used by libvirt for live migration. We rely on xenapi
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index 9124b4dbe..ddd44bb1d 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -1662,6 +1662,7 @@ class VMOps(object):
try:
self._call_live_migrate_command(
"VM.assert_can_migrate", vm_ref, migrate_data)
+ return dest_check_data
except self._session.XenAPI.Failure as exc:
LOG.exception(exc)
raise exception.MigrationError(_('VM.assert_can_migrate'