avocado-framework / avocado-vt

Avocado VT Plugin
https://avocado-vt.readthedocs.org/
Other
83 stars 241 forks source link

libvirt_xml/devices/address: add optional zpci subelement #3975

Open smitterl opened 3 weeks ago

smitterl commented 3 weeks ago

On s390x, there can be a zpci subelement which is used to determine properties inside the guest: uid corresponds to the domain and fid corresponds to the slot number.

smitterl commented 3 weeks ago

Tested manually:

>>> from virttest.libvirt_xml.devices import address as a
>>> addr = a.Address.new_from_dict({"type_name": "pci", "domain": "0x0000", "bus":"0x00", "slot":"0x00", "function":"0x0"})
>>> str(addr)
'<address type="pci" domain="0x0000" bus="0x00" slot="0x00" function="0x0" />'
>>> zpci = addr.Zpci.new_from_dict({"uid":"0x01", "fid":"0x0"})
>>> addr.set_zpci_attrs(zpci)
>>> str(addr)
'<address type="pci" domain="0x0000" bus="0x00" slot="0x00" function="0x0"><zpci uid="0x01" fid="0x0" /></address>'
smitterl commented 3 weeks ago

Used in https://github.com/autotest/tp-libvirt/pull/5853