libvirt/src/test
Cole Robinson 948d496d25 test: nodedev: fill active_config at driver startup time
Commit v10.0.0-265-ge67bca23e4 added a `active_config` and
`defined_config` to nodedev mdev internal XML handling.
`defined_config` can be filled at XML parse time, but `active_config`
must be filled in by nodedev driver. This wasn't implemented for the
test driver however, which caused virt-manager test suite regressions.

Working example:

```
$ virsh --connect test:///home/crobinso/src/virt-manager/tests/data/testdriver/testdriver.xml nodedev-dumpxml mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110
<device>
  <name>mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110</name>
  <path>/sys/devices/css0/0.0.0023/8e37ee90-2b51-45e3-9b25-bf8283c03110</path>
  <parent>css_0_0_0023</parent>
  <capability type='mdev'>
    <type id='vfio_ccw-io'/>
    <iommuGroup number='0'/>
  </capability>
</device>
```

Broken example:

```
$ virsh --connect test:///home/crobinso/src/virt-manager/tests/data/testdriver/testdriver.xml nodedev-dumpxml mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110
<device>
  <name>mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110</name>
  <path>/sys/devices/css0/0.0.0023/8e37ee90-2b51-45e3-9b25-bf8283c03110</path>
  <parent>css_0_0_0023</parent>
  <capability type='mdev'>
    <iommuGroup number='0'/>
  </capability>
</device>
```

There's already code that does what we want in the test suite.
Move it to a shared function, and call it in test driver when
creating a nodedev from driver startup XML.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-04-24 09:38:54 -04:00
..
meson.build
test_driver.c test: nodedev: fill active_config at driver startup time 2024-04-24 09:38:54 -04:00
test_driver.h
test-screenshot.png