[virt-tools-list] [virt-manager PATCH 09/12] osdict: Also return pre-installable devices as part of _get_all_devices()

Fabiano Fidêncio fidencio at redhat.com
Thu Jun 6 14:11:40 UTC 2019


When getting all_devices(), we should also take into consideration the
pre-installable drivers.

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 virtinst/osdict.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index 90aa3d5d..31446380 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -375,7 +375,15 @@ class _OsVariant(object):
     def _get_all_devices(self):
         if not self._os:
             return []
-        return list(_OsinfoIter(self._os.get_all_devices()))
+
+        os_devices = list(_OsinfoIter(self._os.get_all_devices()))
+
+        pre_install_devices = []
+        pre_installable_drivers = self.get_pre_installable_drivers("all")
+        for driver in pre_installable_drivers:
+            pre_install_devices.extend(list(_OsinfoIter(driver.get_devices())))
+
+        return list(set().union(os_devices, pre_install_devices))
 
     def _device_filter(self, devids=None, cls=None):
         ret = []
-- 
2.21.0




More information about the virt-tools-list mailing list