]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodedev: support 'mtty' device for testing
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 15 Jul 2022 19:10:30 +0000 (14:10 -0500)
committerJonathon Jongsma <jjongsma@redhat.com>
Wed, 10 Aug 2022 16:19:03 +0000 (11:19 -0500)
commitab29ddfdf8774eaffbe4d6e83fd47ccb6b1c0308
tree953a543cad433cfa8b5179ba4c9e4635ca40f63e
parent1f14dbccbc9c5daa3aed31798a6413399820cf53
nodedev: support 'mtty' device for testing

It would be nice to be able to test the mediated device capabilities
without having physical hardware which supports it. The 'mtty' kernel
module presents a virtual parent device which is capable of creating
'fake' mediated devices, and as such it would be useful for testing.

However, the 'mtty' device is not part of an existing device subsystem
(e.g. PCI, etc), so libvirt ignores it and it does not get added to the
node device list. And because it does not get added to the node device
list, it cannot be used to create child mdevs using `virsh
nodedev-create`.

There is already a node device type capability
VIR_NODE_DEV_CAP_MDEV_TYPES that indicates whether a device supports
creating child mediated devices, but libvirt assumes that this is a
nested capability (in other words, it assumes that the primary
capability of a device is something like PCI). If we allow this
MDEV_TYPES capability to be a primary device capability, then we can
support virtual devices like 'mtty' as a parent for mediated devices.

See https://bugzilla.redhat.com/show_bug.cgi?id=2107031

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/node_device_conf.c
src/conf/node_device_conf.h
src/libvirt_private.syms
src/node_device/node_device_driver.c
src/node_device/node_device_udev.c
src/util/virmdev.c
src/util/virmdev.h