Skip to content

Commit

Permalink
Merge pull request #3773 from chloerh/iface-tune
Browse files Browse the repository at this point in the history
Add property 'tune' to iface xml
  • Loading branch information
Yingshun committed Oct 23, 2023
2 parents 87bc95f + 0093795 commit 6ce0d7b
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 6ce0d7b

Please sign in to comment.