nodedev: Implement virNodeDeviceUpdate

Implement the API functions in the node device driver by using mdevctl
modify with the options defined and live.
Instead of increasing the minimum mdevctl version to 1.3.0 in the spec
file to ensure support exists in mdevctl the support is dynamically
checked before using mdevctl.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Boris Fiuczynski
2024-02-22 14:02:07 +01:00
committed by Michal Privoznik
parent 69f9e7dbc2
commit 582f27ff15
9 changed files with 380 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
<device>
<name>mdev_c60cc60c_c60c_c60c_c60c_c60cc60cc60c_0_0_0052</name>
<path>/sys/devices/css0/0.0.0052/c60cc60c-c60c-c60c-c60c-c60cc60cc60c</path>
<parent>css_0_0_0052</parent>
<driver>
<name>vfio_ccw_mdev</name>
</driver>
<capability type='mdev'>
<type id='vfio_ccw-io'/>
<uuid>c60cc60c-c60c-c60c-c60c-c60cc60cc60c</uuid>
<parent_addr>0.0.0052</parent_addr>
<attr name='add_attr_1' value='val1'/>
<attr name='add_attr_2' value='val2'/>
<iommuGroup number='4'/>
</capability>
</device>

View File

@@ -0,0 +1,25 @@
mdevctl \
modify \
--parent=0.0.0052 \
--jsonfile=/dev/stdin \
--uuid=c60cc60c-c60c-c60c-c60c-c60cc60cc60c \
--defined
mdevctl \
modify \
--parent=0.0.0052 \
--jsonfile=/dev/stdin \
--uuid=c60cc60c-c60c-c60c-c60c-c60cc60cc60c \
--live
mdevctl \
modify \
--parent=0.0.0052 \
--jsonfile=/dev/stdin \
--uuid=c60cc60c-c60c-c60c-c60c-c60cc60cc60c \
--live
mdevctl \
modify \
--parent=0.0.0052 \
--jsonfile=/dev/stdin \
--uuid=c60cc60c-c60c-c60c-c60c-c60cc60cc60c \
--defined \
--live

View File

@@ -0,0 +1,4 @@
{"mdev_type":"vfio_ccw-io","start":"manual"}
{"mdev_type":"vfio_ccw-io","start":"manual","attrs":[{"add_attr_1":"val1"},{"add_attr_2":"val2"}]}
{"mdev_type":"vfio_ccw-io","start":"manual"}
{"mdev_type":"vfio_ccw-io","start":"manual","attrs":[{"add_attr_1":"val1"},{"add_attr_2":"val2"}]}