Merge "FUP Remove unnecessary PCI check" into stable/2025.1

This commit is contained in:
Zuul
2025-06-03 11:55:42 +00:00
committed by Gerrit Code Review
2 changed files with 0 additions and 39 deletions

View File

@@ -206,32 +206,6 @@ class MoveClaim(Claim):
flavor=self.flavor)
self.instance.drop_migration_context()
def _test_pci(self):
"""Test whether this host can accept this claim's PCI requests. For
live migration, only Neutron SRIOV PCI requests are supported. Any
other type of PCI device would need to be removed and re-added for live
migration to work, and there is currently no support for that. For cold
migration, all types of PCI requests are supported, so we just call up
to normal Claim's _test_pci().
"""
if not self.migration.is_live_migration:
return super(MoveClaim, self)._test_pci()
if self._pci_requests.requests:
for pci_request in self._pci_requests.requests:
if (pci_request.source !=
objects.InstancePCIRequest.NEUTRON_PORT):
return (_('Non-VIF related PCI requests are not '
'supported for live migration.'))
# TODO(artom) At this point, once we've made sure we only have
# NEUTRON_PORT (aka SRIOV) PCI requests, we should check whether
# the host can support them, like Claim._test_pci() does. However,
# SRIOV live migration is currently being handled separately - see
# for example _claim_pci_for_instance_vifs() in the compute
# manager. So we do nothing here to avoid stepping on that code's
# toes, but ideally MoveClaim would be used for all live migration
# resource claims.
def _test_live_migration_page_size(self):
"""Tests that the current page size and the requested page size are the
same.

View File

@@ -372,19 +372,6 @@ class MoveClaimTestCase(ClaimTestCase):
class LiveMigrationClaimTestCase(ClaimTestCase):
def test_live_migration_claim_bad_pci_request(self):
flavor = self._fake_flavor()
instance = self._fake_instance()
instance.numa_topology = None
self.assertRaisesRegex(
exception.ComputeResourcesUnavailable,
'PCI requests are not supported',
claims.MoveClaim, self.context, instance, _NODENAME, flavor,
{}, self.tracker, self.compute_node,
objects.InstancePCIRequests(requests=[
objects.InstancePCIRequest(alias_name='fake-alias')]),
objects.Migration(migration_type='live-migration'), None)
def test_live_migration_page_size(self):
flavor = self._fake_flavor()
instance = self._fake_instance()