diff options
author | Balazs Gibizer <gibi@redhat.com> | 2022-06-17 19:24:47 +0200 |
---|---|---|
committer | Balazs Gibizer <gibi@redhat.com> | 2022-08-25 10:00:10 +0200 |
commit | 07f2bf8035927fc469cd10171cc3dd6f23f1ccf4 (patch) | |
tree | e688b3e75541d5a234651715b3ddc3d85f1049af /nova/exception.py | |
parent | 0d526d1f4bc24d5d6afbdf1b8bb26e9492434944 (diff) | |
download | nova-07f2bf8035927fc469cd10171cc3dd6f23f1ccf4.tar.gz |
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
Diffstat (limited to 'nova/exception.py')
-rw-r--r-- | nova/exception.py | 16 |
1 files changed, 16 insertions, 0 deletions
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." + ) |