]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodedev: handle mdevs from multiple parents
authorJonathon Jongsma <jjongsma@redhat.com>
Thu, 10 Jun 2021 18:15:37 +0000 (13:15 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 1 Jul 2021 14:34:03 +0000 (16:34 +0200)
commite9b534905f4fb03d8f31d007a0d1aa1c911e2a2c
tree9a751ce209817dfe7d9da9acdf949a4d930f8efe
parent9c3b6b7a82373b680a0e4ba4f1baebcb430d45b2
nodedev: handle mdevs from multiple parents

Due to a rather unfortunate misunderstanding, we were parsing the list
of defined devices from mdevctl incorrectly. Since my primary
development machine only has a single device capable of mdevs, I
apparently neglected to test multiple parent devices and made some
assumptions based on reading the mdevctl code. These assumptions turned
out to be incorrect, so the parsing failed when devices from more than
one parent device were returned.

The details: mdevctl returns an array of objects representing the
defined devices. But instead of an array of multiple objects (with each
object representing a parent device), the array always contains only a
single object. That object has a separate property for each parent
device.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/node_device/node_device_driver.c
tests/nodedevmdevctldata/mdevctl-list-multiple.json