libvirt/tests/nodedevmdevctldata/mdevctl-list-multiple.out.xml
Jonathon Jongsma 51fbbfdce8 nodedev: fix parent device of inactive mdevs
Inactive mdevs were simply formatting their parent name as the value
received from mdevctl rather than looking up the libvirt nodedev name of
the parent device. This resulted in a parent value of e.g.
'0000:5b:00.0' instead of 'pci_0000_5b_00_0'. This prevented defining a
new mdev device from the output of nodedev-dumpxml.

Unfortunately, it's not simple to fix this comprehensively due to the
fact that mdevctl supports defining (inactive) mdevs for parent devices
that do not actually exist on the host (yet). So for those persistent
mdev definitions that do not have a valid parent in the device list, the
parent device will be set to the root "computer" device.

Unfortunately, because the value of the 'parent' field now depends on
the configuration of the host, the mdevctl parsing test will output
'computer' for all test devices. Fixing this would require a more
extensive mock test environment.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1979761

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-07-19 11:25:43 +02:00

44 lines
1.3 KiB
XML

<device>
<name>mdev_200f228a_c80a_4d50_bfb7_f5a0e4e34045</name>
<parent>computer</parent>
<capability type='mdev'>
<type id='i915-GVTg_V5_4'/>
<uuid>200f228a-c80a-4d50-bfb7-f5a0e4e34045</uuid>
<iommuGroup number='0'/>
</capability>
</device>
<device>
<name>mdev_de807ffc_1923_4d5f_b6c9_b20ecebc6d4b</name>
<parent>computer</parent>
<capability type='mdev'>
<type id='i915-GVTg_V5_4'/>
<uuid>de807ffc-1923-4d5f-b6c9-b20ecebc6d4b</uuid>
<iommuGroup number='0'/>
</capability>
</device>
<device>
<name>mdev_435722ea_5f43_468a_874f_da34f1217f13</name>
<parent>computer</parent>
<capability type='mdev'>
<type id='i915-GVTg_V5_8'/>
<uuid>435722ea-5f43-468a-874f-da34f1217f13</uuid>
<iommuGroup number='0'/>
<attr name='testattr' value='42'/>
</capability>
</device>
<device>
<name>mdev_783e6dbb_ea0e_411f_94e2_717eaad438bf</name>
<parent>computer</parent>
<capability type='mdev'>
<type id='vfio_ap-passthrough'/>
<uuid>783e6dbb-ea0e-411f-94e2-717eaad438bf</uuid>
<iommuGroup number='0'/>
<attr name='assign_adapter' value='5'/>
<attr name='assign_adapter' value='6'/>
<attr name='assign_domain' value='0xab'/>
<attr name='assign_control_domain' value='0xab'/>
<attr name='assign_domain' value='4'/>
<attr name='assign_control_domain' value='4'/>
</capability>
</device>