]> git.ipfire.org Git - thirdparty/libvirt.git/commit
nodedev: Handle inactive mdevs with the same UUID
authorJonathon Jongsma <jjongsma@redhat.com>
Tue, 6 Jul 2021 18:41:28 +0000 (13:41 -0500)
committerJonathon Jongsma <jjongsma@redhat.com>
Fri, 6 Aug 2021 20:02:38 +0000 (15:02 -0500)
commit3bd8181bc5548a0ce81107cbfb480dfdcba5679d
tree479dd7f461930b9c9d40be93d99c7e4347ef0c7d
parent08d29eb3b1d2361b7c70eaf0e269165387cf2756
nodedev: Handle inactive mdevs with the same UUID

Unfortunately, mdevctl supports defining more than one mdev with the
same UUID as long as they have different parent devices. (Only one of
these devices can be active at any given time).

This means that we can't use the UUID alone as a way to uniquely
identify mdev node devices. Append the parent address to ensure
uniqueness. For example:

    Before: mdev_88a6b868_46bd_4015_8e5b_26107f82da38
    After:  mdev_88a6b868_46bd_4015_8e5b_26107f82da38_0000_00_02_0

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1979440

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