nodedev: support auto-start property for mdevs

This adds a new element to the mdev capabilities xml schema that
represents the start policy for a defined mediated device. The actual
auto-start functionality is handled behind the scenes by mdevctl, but it
wasn't yet hooked up in libvirt.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Boris Fiuczynski
2021-05-14 16:28:59 -05:00
committed by Michal Privoznik
parent 86ecc06c06
commit 42a5585499
9 changed files with 83 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
<capability type='mdev'>
<type id='i915-GVTg_V5_4'/>
<uuid>200f228a-c80a-4d50-bfb7-f5a0e4e34045</uuid>
<start type='manual'/>
<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>
<start type='auto'/>
<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>
<start type='manual'/>
<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>
<start type='manual'/>
<iommuGroup number='0'/>
<attr name='assign_adapter' value='5'/>
<attr name='assign_adapter' value='6'/>

View File

@@ -1 +0,0 @@
../nodedevschemadata/mdev_3627463d_b7f0_4fea_b468_f1da537d301b.xml

View File

@@ -0,0 +1,9 @@
<device>
<name>mdev_3627463d_b7f0_4fea_b468_f1da537d301b</name>
<parent>computer</parent>
<capability type='mdev'>
<type id='mtty-1'/>
<start type='manual'/>
<iommuGroup number='12'/>
</capability>
</device>

View File

@@ -1 +0,0 @@
../nodedevschemadata/mdev_ee0b88c4_f554_4dc1_809d_b2a01e8e48ad.xml

View File

@@ -0,0 +1,10 @@
<device>
<name>mdev_ee0b88c4-f554-4dc1-809d-b2a01e8e48ad</name>
<path>/sys/devices/vfio_ap/matrix/mdev_ee0b88c4-f554-4dc1-809d-b2a01e8e48ad</path>
<parent>ap_matrix</parent>
<capability type='mdev'>
<type id='vfio_ap-passthrough'/>
<start type='manual'/>
<iommuGroup number='0'/>
</capability>
</device>