diff --git a/os_traits/hw/cpu/__init__.py b/os_traits/hw/cpu/__init__.py index e69de29..2a96efd 100644 --- a/os_traits/hw/cpu/__init__.py +++ b/os_traits/hw/cpu/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +# A few generalized capabilities of some RP +TRAITS = [ + # The resource provider decorated with this trait indicates that + # hyperthreading is enabled on the provider. + # Operators of resource-constrained systems would be able to decorate a + # single NUMA node resource provider on a multi-socket system with this + # HW_CPU_HYPERTHREADING trait to “carve out” a part of the host system + # for guests that can tolerate hyperthread siblings providing CPU + # resources. + 'HYPERTHREADING', +] diff --git a/os_traits/tests/test_os_traits.py b/os_traits/tests/test_os_traits.py index 6b83caf..afda2d4 100644 --- a/os_traits/tests/test_os_traits.py +++ b/os_traits/tests/test_os_traits.py @@ -41,6 +41,7 @@ class TestSymbols(base.TestCase): def test_get_traits_filter_by_prefix(self): traits = ot.get_traits('HW_CPU') self.assertIn("HW_CPU_X86_SSE42", traits) + self.assertIn("HW_CPU_HYPERTHREADING", traits) self.assertIn(ot.HW_CPU_X86_AVX2, traits) self.assertNotIn(ot.STORAGE_DISK_SSD, traits) self.assertNotIn(ot.HW_NIC_SRIOV, traits)