diff options
Diffstat (limited to 'nova/api/validation/extra_specs/hw.py')
-rw-r--r-- | nova/api/validation/extra_specs/hw.py | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/nova/api/validation/extra_specs/hw.py b/nova/api/validation/extra_specs/hw.py index 4aaccf639a..c0c8f02809 100644 --- a/nova/api/validation/extra_specs/hw.py +++ b/nova/api/validation/extra_specs/hw.py @@ -15,6 +15,7 @@ """Validators for ``hw`` namespaced extra specs.""" from nova.api.validation.extra_specs import base +from nova.objects import fields realtime_validators = [ @@ -162,6 +163,18 @@ hugepage_validators = [ 'pattern': r'(large|small|any|\d+([kKMGT]i?)?(b|bit|B)?)', }, ), + base.ExtraSpecValidator( + name='hw:locked_memory', + description=( + 'Determine if **guest** (instance) memory should be locked ' + 'preventing swaping. This is required in rare cases for device ' + 'DMA transfers. Only supported by the libvirt virt driver.' + ), + value={ + 'type': bool, + 'description': 'Whether to lock **guest** (instance) memory.', + }, + ), ] numa_validators = [ @@ -498,6 +511,47 @@ feature_flag_validators = [ ], }, ), + base.ExtraSpecValidator( + name='hw:viommu_model', + description=( + 'This can be used to set model for virtual IOMMU device.' + ), + value={ + 'type': str, + 'enum': [ + 'intel', + 'smmuv3', + 'virtio', + 'auto' + ], + 'description': 'model for vIOMMU', + }, + ), +] + +ephemeral_encryption_validators = [ + base.ExtraSpecValidator( + name='hw:ephemeral_encryption', + description=( + 'Whether to enable ephemeral storage encryption.' + ), + value={ + 'type': bool, + 'description': 'Whether to enable ephemeral storage encryption.', + }, + ), + base.ExtraSpecValidator( + name='hw:ephemeral_encryption_format', + description=( + 'The encryption format to be used if ephemeral storage ' + 'encryption is enabled via hw:ephemeral_encryption.' + ), + value={ + 'type': str, + 'description': 'The encryption format to be used if enabled.', + 'enum': fields.BlockDeviceEncryptionFormatType.ALL, + }, + ), ] @@ -509,5 +563,6 @@ def register(): hugepage_validators + numa_validators + cpu_topology_validators + - feature_flag_validators + feature_flag_validators + + ephemeral_encryption_validators ) |