From 7be9e161c21cb6b9dfd6290f58b1a2aba746f42d Mon Sep 17 00:00:00 2001 From: Sebastian Mitterle Date: Thu, 11 Apr 2024 03:07:43 -0400 Subject: [PATCH] libvirt_xml/input: add type attribute Add @type for selection of elements by their type. Signed-off-by: Sebastian Mitterle --- virttest/libvirt_xml/devices/input.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/virttest/libvirt_xml/devices/input.py b/virttest/libvirt_xml/devices/input.py index 59fbeb5c58..28beedf0be 100644 --- a/virttest/libvirt_xml/devices/input.py +++ b/virttest/libvirt_xml/devices/input.py @@ -9,7 +9,15 @@ class Input(base.TypedDeviceBase): - __slots__ = ("input_bus", "model", "address", "source_evdev", "driver", "alias") + __slots__ = ( + "input_bus", + "input_type", + "model", + "address", + "source_evdev", + "driver", + "alias", + ) def __init__(self, type_name, virsh_instance=base.base.virsh): super(Input, self).__init__( @@ -23,6 +31,14 @@ def __init__(self, type_name, virsh_instance=base.base.virsh): tag_name="input", attribute="bus", ) + accessors.XMLAttribute( + property_name="input_type", + libvirtxml=self, + forbidden=None, + parent_xpath="/", + tag_name="input", + attribute="type", + ) accessors.XMLAttribute( property_name="model", libvirtxml=self,