nodedev: add parent_addr to mdev nodedev dumpxml

As the parent address is part of the mdev nodedev name lets expose the
internally available parent address in the XML.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Boris Fiuczynski 2022-02-04 16:32:18 +01:00 committed by Michal Privoznik
parent 609836e2b2
commit f087335034
3 changed files with 12 additions and 0 deletions

View File

@ -644,6 +644,11 @@
<ref name="UUID"/>
</element>
</optional>
<optional>
<element name="parent_addr">
<data type="string"/>
</element>
</optional>
<zeroOrMore>
<element name="attr">
<attribute name="name"/>

View File

@ -604,6 +604,8 @@ virNodeDeviceCapMdevDefFormat(virBuffer *buf,
virBufferEscapeString(buf, "<type id='%s'/>\n", data->mdev.type);
virBufferEscapeString(buf, "<uuid>%s</uuid>\n", data->mdev.uuid);
virBufferEscapeString(buf, "<parent_addr>%s</parent_addr>\n",
data->mdev.parent_addr);
virBufferAsprintf(buf, "<iommuGroup number='%u'/>\n",
data->mdev.iommuGroupNumber);

View File

@ -4,6 +4,7 @@
<capability type='mdev'>
<type id='i915-GVTg_V5_4'/>
<uuid>200f228a-c80a-4d50-bfb7-f5a0e4e34045</uuid>
<parent_addr>0000:00:02.0</parent_addr>
<iommuGroup number='0'/>
</capability>
</device>
@ -13,6 +14,7 @@
<capability type='mdev'>
<type id='i915-GVTg_V5_4'/>
<uuid>de807ffc-1923-4d5f-b6c9-b20ecebc6d4b</uuid>
<parent_addr>0000:00:02.0</parent_addr>
<iommuGroup number='0'/>
</capability>
</device>
@ -22,6 +24,7 @@
<capability type='mdev'>
<type id='i915-GVTg_V5_8'/>
<uuid>435722ea-5f43-468a-874f-da34f1217f13</uuid>
<parent_addr>0000:00:02.0</parent_addr>
<iommuGroup number='0'/>
<attr name='testattr' value='42'/>
</capability>
@ -32,6 +35,7 @@
<capability type='mdev'>
<type id='vfio_ap-passthrough'/>
<uuid>783e6dbb-ea0e-411f-94e2-717eaad438bf</uuid>
<parent_addr>matrix</parent_addr>
<iommuGroup number='0'/>
<attr name='assign_adapter' value='5'/>
<attr name='assign_adapter' value='6'/>
@ -47,6 +51,7 @@
<capability type='mdev'>
<type id='vfio_ccw-io'/>
<uuid>cc000052-9b13-9b13-9b13-cc23009b1326</uuid>
<parent_addr>0.0.0052</parent_addr>
<iommuGroup number='0'/>
</capability>
</device>