Skip to content

Commit

Permalink
Add the element thread_pool to filesystem device
Browse files Browse the repository at this point in the history
Signed-off-by: Lili Zhu <[email protected]>
  • Loading branch information
iccaszhulili committed Jul 10, 2022
1 parent 85a8b1e commit 1b63937
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion virttest/libvirt_xml/devices/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ class Binary(base.base.LibvirtXMLBase):
<binary path='/usr/libexec/virtiofsd' xattr='on'>
<cache mode='always'/>
<lock posix='on' flock='on'/>
<thread_pool size='16'/>
</binary>
"""
__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,
Expand All @@ -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 = '<binary/>'
3 changes: 3 additions & 0 deletions virttest/utils_test/libvirt_device_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b63937

Please sign in to comment.