xenapi: Remove Xen-only code paths
Change-Id: I7fa825bbe8e9536963badd0f431b83dcbbabfdd6 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
7991155454
commit
b93debd12c
@ -39,13 +39,7 @@ def main():
|
||||
CONF.set_default('web', '/usr/share/novnc')
|
||||
config.parse_args(sys.argv)
|
||||
|
||||
# TODO(stephenfin): Always enable the security proxy once we support RFB
|
||||
# version 3.3, as used in XenServer.
|
||||
security_proxy = None
|
||||
if CONF.compute_driver != 'xenapi.XenAPIDriver':
|
||||
security_proxy = rfb.RFBSecurityProxy()
|
||||
|
||||
baseproxy.proxy(
|
||||
host=CONF.vnc.novncproxy_host,
|
||||
port=CONF.vnc.novncproxy_port,
|
||||
security_proxy=security_proxy)
|
||||
security_proxy=rfb.RFBSecurityProxy())
|
||||
|
@ -8460,9 +8460,6 @@ class ComputeManager(manager.Manager):
|
||||
# vpmem must be cleanped
|
||||
do_cleanup = not migrate_data.is_shared_instance_path or has_vpmem
|
||||
destroy_disks = not migrate_data.is_shared_block_storage
|
||||
elif isinstance(migrate_data, migrate_data_obj.XenapiLiveMigrateData):
|
||||
do_cleanup = migrate_data.block_migration
|
||||
destroy_disks = migrate_data.block_migration
|
||||
elif isinstance(migrate_data, migrate_data_obj.HyperVLiveMigrateData):
|
||||
# NOTE(claudiub): We need to cleanup any zombie Planned VM.
|
||||
do_cleanup = True
|
||||
|
@ -778,6 +778,8 @@ class DiskFormat(BaseNovaEnum):
|
||||
ALL = (RBD, LVM, QCOW2, RAW, PLOOP, VHD, VMDK, VDI, ISO)
|
||||
|
||||
|
||||
# TODO(stephenfin): Remove the xenapi value when we bump the 'Diagnostics'
|
||||
# object (the only user of this enum) to 2.0
|
||||
class HypervisorDriver(BaseNovaEnum):
|
||||
LIBVIRT = "libvirt"
|
||||
XENAPI = "xenapi"
|
||||
|
@ -6223,8 +6223,10 @@ class ComputeTestCase(BaseTestCase,
|
||||
fake_bdms.append(bdms)
|
||||
return bdms
|
||||
|
||||
migrate_data = migrate_data_obj.XenapiLiveMigrateData(
|
||||
block_migration=True)
|
||||
migrate_data = migrate_data_obj.LibvirtLiveMigrateData(
|
||||
block_migration=True,
|
||||
is_shared_instance_path=False,
|
||||
is_shared_block_storage=False)
|
||||
|
||||
mock_pre.side_effect = test.TestingException
|
||||
mock_get_bdms.side_effect = gen_fake_bdms
|
||||
@ -6244,9 +6246,9 @@ class ComputeTestCase(BaseTestCase,
|
||||
# submitted to a thread executor raises, the exception will not be
|
||||
# raised unless Future.result() is called.
|
||||
self.compute.live_migration(
|
||||
c, dest=dest_host, block_migration=True,
|
||||
instance=instance, migration=migration,
|
||||
migrate_data=migrate_data)
|
||||
c, dest=dest_host, block_migration=True,
|
||||
instance=instance, migration=migration,
|
||||
migrate_data=migrate_data)
|
||||
mock_setup.assert_called_once_with(c, instance, self.compute.host)
|
||||
mock_client.move_allocations.assert_called_once_with(
|
||||
c, migration.uuid, instance.uuid)
|
||||
@ -6261,8 +6263,8 @@ class ComputeTestCase(BaseTestCase,
|
||||
self.assertEqual('failed', migration.status)
|
||||
mock_get_disk.assert_called()
|
||||
mock_pre.assert_called_once_with(c,
|
||||
instance, True, mock_get_disk.return_value, dest_host,
|
||||
migrate_data)
|
||||
instance, True, mock_get_disk.return_value, dest_host,
|
||||
migrate_data)
|
||||
|
||||
# Assert that _rollback_live_migration puts connection_info back to
|
||||
# what it was before the call to pre_live_migration.
|
||||
@ -6288,7 +6290,7 @@ class ComputeTestCase(BaseTestCase,
|
||||
mock_rollback.assert_called_once_with(c, instance, dest_host,
|
||||
destroy_disks=True,
|
||||
migrate_data=test.MatchType(
|
||||
migrate_data_obj.XenapiLiveMigrateData))
|
||||
migrate_data_obj.LibvirtLiveMigrateData))
|
||||
# Assert that the final attachment_ids returned by
|
||||
# BlockDeviceMappingList.get_by_instance_uuid are then deleted.
|
||||
mock_attachment_delete.assert_has_calls([
|
||||
|
@ -10435,20 +10435,6 @@ class ComputeManagerMigrationTestCase(test.NoDBTestCase,
|
||||
self.assertFalse(do_cleanup)
|
||||
self.assertFalse(destroy_disks)
|
||||
|
||||
def test_live_migration_cleanup_flags_block_migrate_xenapi(self):
|
||||
migrate_data = objects.XenapiLiveMigrateData(block_migration=True)
|
||||
do_cleanup, destroy_disks = self.compute._live_migration_cleanup_flags(
|
||||
migrate_data)
|
||||
self.assertTrue(do_cleanup)
|
||||
self.assertTrue(destroy_disks)
|
||||
|
||||
def test_live_migration_cleanup_flags_live_migrate_xenapi(self):
|
||||
migrate_data = objects.XenapiLiveMigrateData(block_migration=False)
|
||||
do_cleanup, destroy_disks = self.compute._live_migration_cleanup_flags(
|
||||
migrate_data)
|
||||
self.assertFalse(do_cleanup)
|
||||
self.assertFalse(destroy_disks)
|
||||
|
||||
def test_live_migration_cleanup_flags_live_migrate(self):
|
||||
do_cleanup, destroy_disks = self.compute._live_migration_cleanup_flags(
|
||||
{})
|
||||
|
Loading…
x
Reference in New Issue
Block a user