The extract below was taken from the domain xml for an instance that failed diagnostics command
and shows that "target dev" is present under regular bridge interface, but is missing from vfio interface:
As a result, method _get_io_devices() only returns the bridge interface when called by get_instance_diagnostics() and
the following loop:
for interface in dom_io["ifaces"]:
only gets executed once.
This in turn results in having only diags.nic_details[0] created.
In the failing loop at the end of method get_instance_diagnostics, the code looks in the domain xml for ./devices/interface/mac,
and finds the 2 interface occurences, therefore exceeding the max index by 1 when trying to write to diags.nic_details[index].mac_address
The extract below was taken from the domain xml for an instance that failed diagnostics command
and shows that "target dev" is present under regular bridge interface, but is missing from vfio interface:
<interface type='bridge'> 'fa:16: 3e:c1:e3: fe'/> 'qbr275587c1- 50'/> 1-50'/> <<<<<<< target dev only present under this interface 'fa:16: 3e:6f:4d: bc'/>
<origstates>
<unbind/ >
</origstates >
<mac address=
<source bridge=
<target dev='tap275587c
<model type='virtio'/>
<mtu size='9000'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<interface type='hostdev' managed='yes'>
<mac address=
<driver name='vfio'/>
<source>
<address type='pci' domain='0x0000' bus='0x04' slot='0x17' function='0x4'/>
</source>
<vlan>
<tag id='0'/>
</vlan>
<alias name='hostdev0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>
As a result, method _get_io_devices() only returns the bridge interface when called by get_instance_ diagnostics( ) and details[ 0] created.
the following loop:
for interface in dom_io["ifaces"]:
only gets executed once.
This in turn results in having only diags.nic_
In the failing loop at the end of method get_instance_ diagnostics, the code looks in the domain xml for ./devices/ interface/ mac, details[ index]. mac_address
and finds the 2 interface occurences, therefore exceeding the max index by 1 when trying to write to diags.nic_