From 1b63937164a02b1ec38a6dff81c6cb3d7aa2f159 Mon Sep 17 00:00:00 2001 From: Lili Zhu Date: Sun, 10 Jul 2022 04:11:51 -0400 Subject: [PATCH] Add the element thread_pool to filesystem device Signed-off-by: Lili Zhu --- virttest/libvirt_xml/devices/filesystem.py | 8 +++++++- virttest/utils_test/libvirt_device_utils.py | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/virttest/libvirt_xml/devices/filesystem.py b/virttest/libvirt_xml/devices/filesystem.py index 28c0eb26ce..8143a18dd6 100644 --- a/virttest/libvirt_xml/devices/filesystem.py +++ b/virttest/libvirt_xml/devices/filesystem.py @@ -41,9 +41,11 @@ class Binary(base.base.LibvirtXMLBase): + """ - __slots__ = ('path', 'xattr', 'cache_mode', 'lock_posix', 'flock') + __slots__ = ('path', 'xattr', 'cache_mode', 'lock_posix', + 'flock', 'thread_pool_size') def __init__(self, virsh_instance=base.base.virsh): accessors.XMLAttribute('path', self, @@ -66,5 +68,9 @@ def __init__(self, virsh_instance=base.base.virsh): parent_xpath='/', tag_name='lock', attribute='flock') + accessors.XMLAttribute('thread_pool_size', self, + parent_xpath='/', + tag_name='thread_pool', + attribute='size') super(self.__class__, self).__init__(virsh_instance=virsh_instance) self.xml = '' diff --git a/virttest/utils_test/libvirt_device_utils.py b/virttest/utils_test/libvirt_device_utils.py index 65cfb1d57c..b22dd78162 100644 --- a/virttest/utils_test/libvirt_device_utils.py +++ b/virttest/utils_test/libvirt_device_utils.py @@ -32,10 +32,13 @@ def create_fs_xml(fsdev_dict, launched_mode='auto'): xattr = binary_dict.get('xattr', 'on') lock_posix = binary_dict.get('lock_posix', 'on') flock = binary_dict.get('flock', 'on') + thread_pool_size = binary_dict.get('thread_pool_size') if cache_mode != "auto": binary_xml.cache_mode = cache_mode if xattr != "": binary_xml.xattr = xattr + if thread_pool_size: + binary_xml.thread_pool_size = thread_pool_size binary_xml.path = path binary_xml.lock_posix = lock_posix binary_xml.flock = flock