From 06435824dcd645bf6136453d491f4746e78c3f00 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Fri, 31 Jan 2025 06:45:40 +1100 Subject: [PATCH] Add traits for sound and USB devices on instances. This will be used by I2faeda0fd0fb9c8894d69558a1ccaab8da9f6a1b to support sound and USB contoller devices for the SPICE VDI protocol. Change-Id: Ifda3475cfa08cab392c5afb4fd6f43a0556503f8 --- os_traits/compute/sound.py | 27 +++++++++++++++++++++++++++ os_traits/compute/usb.py | 23 +++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 os_traits/compute/sound.py create mode 100644 os_traits/compute/usb.py diff --git a/os_traits/compute/sound.py b/os_traits/compute/sound.py new file mode 100644 index 0000000..c91dece --- /dev/null +++ b/os_traits/compute/sound.py @@ -0,0 +1,27 @@ +# -*- 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. + +TRAITS = [ + # Traits corresponding to the allowed values of "hw_sound_model" + # image metadata property. These are used by the nova libvirt driver and + # are listed at https://libvirt.org/formatdomain.html#sound-devices + 'MODEL_SB16', + 'MODEL_ES1370', + 'MODEL_PCSPK', + 'MODEL_AC97', + 'MODEL_ICH6', + 'MODEL_ICH9', + 'MODEL_USB', + 'MODEL_VIRTIO' +] diff --git a/os_traits/compute/usb.py b/os_traits/compute/usb.py new file mode 100644 index 0000000..b6be0d9 --- /dev/null +++ b/os_traits/compute/usb.py @@ -0,0 +1,23 @@ +# -*- 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. + +TRAITS = [ + # Traits corresponding to the allowed values of "hw_usb_model" + # image metadata property. These are used by the nova libvirt driver + # however we have decided for now to not support the other older options + # for performance and support reasons. Options are documented at + # https://libvirt.org/formatdomain.html#controllers + 'MODEL_QEMU_XHCI', + 'MODEL_NEC_XHCI' +]