]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodedev: cache parent address in mdev caps
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 16 Jul 2021 18:15:54 +0000 (13:15 -0500)
committerJonathon Jongsma <jjongsma@redhat.com>
Fri, 6 Aug 2021 20:02:29 +0000 (15:02 -0500)
commite44408dd9c45cb4f5e41caef4a9d2b7d2b8eb528
tree9d0a49c58acba35387fbebf98b13a81cd87e85bc
parenta9c1febcf43544fb9b9e59e8b45161d11260d9aa
nodedev: cache parent address in mdev caps

mdevctl can report multiple defined devices with the same UUID
but different parents, including parents that don't actually exist on
the host machine. Libvirt sets the parent to the 'computer' device for
all of the mdevs that have nonexistent parents. Because of this, it's
possible that there are multiple devices with the same UUID and the same
'computer' device as their parent, so the combination of uuid and parent
nodedev name is not guaranteed to be a unique name.

We need to ensure that each nodedev has a unique name. If we can't use
the UUID as a unique nodedev name, and we can't use the combination of
UUID and nodedev parent name, we need to find another solution. By
caching and using the parent name reported by mdevctl in combination
with the UUID, we can achieve a unique name. mdevctl guarantees that its
uuid/parent combination is unique.

This value will be used to set the mdev nodedev name in a following commit.

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/node_device/node_device_driver.c
src/node_device/node_device_udev.c