From 07f2bf8035927fc469cd10171cc3dd6f23f1ccf4 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Fri, 17 Jun 2022 19:24:47 +0200 Subject: Reject mixed VF rc and trait config If two VFs from the same PF are configured by two separate [pci]device_spec entries then it is possible to define contradicting resource classes or traits. This patch detects and rejects such configuration. blueprint: pci-device-tracking-in-placement Change-Id: I623ab24940169991a400eba854c9619a11662a91 --- nova/exception.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'nova/exception.py') diff --git a/nova/exception.py b/nova/exception.py index 5d167bd5d4..bf69b4409d 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -2440,3 +2440,19 @@ class PlacementPciDependentDeviceException(PlacementPciException): "[pci]device_spec is not supported. Either the parent PF or its " "children VFs can be configured." ) + + +class PlacementPciMixedResourceClassException(PlacementPciException): + msg_fmt = _( + "VFs from the same PF cannot be configured with different " + "'resource_class' values in [pci]device_spec. We got %(new_rc)s " + "for %(new_dev)s and %(current_rc)s for %(current_devs)s." + ) + + +class PlacementPciMixedTraitsException(PlacementPciException): + msg_fmt = _( + "VFs from the same PF cannot be configured with different set " + "of 'traits' in [pci]device_spec. We got %(new_traits)s for " + "%(new_dev)s and %(current_traits)s for %(current_devs)s." + ) -- cgit v1.2.1