Open smitterl opened 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>'
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.