diff options
author | Billy Olsen <billy.olsen@gmail.com> | 2022-04-21 19:42:27 -0700 |
---|---|---|
committer | Sylvain Bauza <sbauza@redhat.com> | 2022-11-30 14:04:28 +0100 |
commit | 98d8c9eaa3c415cc234193e6a9115db887751363 (patch) | |
tree | 3812af48f759a5e3654097609f38363becf0e1f4 /nova/virt/libvirt/host.py | |
parent | 857df72d3166a8f7e8a8cdfeabb62ad6ead46565 (diff) | |
download | nova-98d8c9eaa3c415cc234193e6a9115db887751363.tar.gz |
Handle mdev devices in libvirt 7.7+
Libvirt 7.7 changed the mdev device naming to include the parent PCI
device when listing node devices. The domain, however, will still only
see the UUID and not see the parent PCI device. Changing the parsing to
simply drop the PCI identifier is not enough as the device cannot be
found when attempting to lookup the new ID.
Modify the Libvirt Driver's _get_mediated_device_information to tolerate
different formats of the mdev name. This first uses the legacy behavior
by trying to lookup the device name that is passed in (typically
mdev_<uuid> format) and if that is not found, iterates the list of mdev
node devices until the right UUID is found and selects that one.
Note that the lookup of the mdev device by UUID are needed in order
to keep the ability to recreate assigned mediated devices on a reboot of
the compute node.
Additionally, the libvirt utils parsing method mdev_name2uuid, has
been updated to tolerate both mdev_<uuid> and mdev_<uuid>_<pciid>
formats.
Closes-Bug: 1951656
Change-Id: Ifed0fa16053228990a6a8df8d4c666521db7e329
(cherry picked from commit a28b907c4f0dbba6e141a8fbea807e6cb0438977)
Diffstat (limited to 'nova/virt/libvirt/host.py')
-rw-r--r-- | nova/virt/libvirt/host.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/virt/libvirt/host.py b/nova/virt/libvirt/host.py index 785acdcd18..46435a9a7f 100644 --- a/nova/virt/libvirt/host.py +++ b/nova/virt/libvirt/host.py @@ -1566,7 +1566,7 @@ class Host(object): def list_mediated_devices(self, flags=0): """Lookup mediated devices. - :returns: a list of virNodeDevice instance + :returns: a list of strings with the name of the instance """ return self._list_devices("mdev", flags=flags) |