Skip to content

Commit

Permalink
Add property 'tune' to iface xml
Browse files Browse the repository at this point in the history
Signed-off-by: Haijiao Zhao <[email protected]>
  • Loading branch information
chloerh committed Sep 27, 2023
1 parent c1a4895 commit 0093795
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion virttest/libvirt_xml/devices/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class Interface(base.TypedDeviceBase):
'bandwidth', 'model', 'coalesce', 'link_state', 'target', 'driver',
'address', 'boot', 'rom', 'mtu', 'filterref', 'backend',
'virtualport', 'alias', "ips", "teaming", "vlan", "port",
'acpi', 'portForwards', 'trustGuestRxFilters', 'source_local')
'acpi', 'portForwards', 'trustGuestRxFilters', 'source_local',
'tune')

def __init__(self, type_name='network', virsh_instance=base.base.virsh):
super(Interface, self).__init__(device_tag='interface',
Expand Down Expand Up @@ -161,6 +162,12 @@ def __init__(self, type_name='network', virsh_instance=base.base.virsh):
marshal_from=self.marshal_from_portForwards,
marshal_to=self.marshal_to_portForwards,
has_subclass=True)
accessors.XMLElementNest('tune', self,
parent_xpath='/',
tag_name='tune',
subclass=self.Tune,
subclass_dargs={
'virsh_instance': virsh_instance})

# For convenience
Address = librarian.get('address')
Expand Down Expand Up @@ -427,3 +434,23 @@ def marshal_to_ranges(tag, attr_dict, index, libvirtxml):
if not tag == 'range':
return None
return dict(attr_dict)

class Tune(base.base.LibvirtXMLBase):
"""
Interface tune xml class.
Properties:
sndbuf:
int
"""
__slots__ = ('sndbuf',)

def __init__(self, virsh_instance=base.base.virsh):
accessors.XMLElementInt(property_name='sndbuf',
libvirtxml=self,
forbidden=None,
parent_xpath='/',
tag_name='sndbuf')
super(self.__class__, self).__init__(virsh_instance=virsh_instance)
self.xml = '<tune/>'

0 comments on commit 0093795

Please sign in to comment.