Merge "Follow up for the PCI in placement series"

This commit is contained in:
Zuul 2022-09-06 16:30:11 +00:00 committed by Gerrit Code Review
commit 36091a7ed7
4 changed files with 5 additions and 15 deletions

View File

@ -401,16 +401,6 @@ class PlacementView:
}
raise exception.PlacementPciException(error=msg)
if 'instance_uuid' in dev and dev.instance_uuid:
# The device is allocated to an instance, so we need to make sure
# the device will be allocated to the instance in placement too
# FIXME(gibi): During migration the source host allocation should
# be tight to the migration_uuid as consumer in placement. But
# the PciDevice.instance_uuid is still pointing to the
# instance_uuid both on the source and the dest. So we need to
# check for running migrations.
pass
def _remove_child(self, dev: pci_device.PciDevice) -> None:
rp_name = self._get_rp_name_for_child(dev)
self._ensure_rp(rp_name).remove_child(dev)

View File

@ -1245,8 +1245,8 @@ class Instance(base.NovaPersistentObject, base.NovaObject,
# return early to avoid an extra lazy load on self.pci_requests
# if there are no devices allocated to be filtered
return []
else:
devs = self.pci_devices.objects
devs = self.pci_devices.objects
if request_id is not None:
devs = [dev for dev in devs if dev.request_id == request_id]

View File

@ -1391,8 +1391,8 @@ class SchedulerReportClient(object):
# the conflict exception. This signals the resource tracker to
# redrive the update right away rather than waiting until the
# next periodic.
with excutils.save_and_reraise_exception():
self._clear_provider_cache_for_tree(rp_uuid)
self._clear_provider_cache_for_tree(rp_uuid)
raise
except helper_exceptions:
# Invalidate the relevant part of the cache. It gets rebuilt on
# the next pass.

View File

@ -1973,7 +1973,7 @@ class TestUpdateComputeNode(BaseTestCase):
"""Assert that if the pci placement reporting code tries to remove
inventory with allocation from placement due to invalid hypervisor
or [pci]device_spec reconfiguration then the InventoryInUse error from
placement is propagated and makes the compute startup to fail.
placement is propagated and makes the compute startup fail.
"""
compute_obj = _COMPUTE_NODE_FIXTURES[0].obj_clone()
self._setup_rt()