[virt-tools-list] [virt-manager PATCH v2 23/25] installertreemedia: Get medias kernel/initrd from libosinfo

Fabiano Fidêncio fidencio at redhat.com
Tue Feb 26 09:43:54 UTC 2019


Let's make _get_cached_data() also check for the media being used,
whenever an ISO is used with "--location" and let's get, from libosinfo,
the kernel and initrd path inside the media and add those to the kernel
pair list.

By doing this, the media's kernel and initrd can be used without the
user having to explicitly pass them when calling virt-install.

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

diff --git a/virtinst/installertreemedia.py b/virtinst/installertreemedia.py
index 2988c198..4d77d0dd 100644
--- a/virtinst/installertreemedia.py
+++ b/virtinst/installertreemedia.py
@@ -123,6 +123,10 @@ class InstallerTreeMedia(object):
         if not self._cached_data:
             has_location_kernel = bool(
                     self._location_kernel and self._location_initrd)
+            has_location_kernel_from_iso = bool(
+                    self._media and
+                    self._media.get_kernel_path() and
+                    self._media.get_initrd_path())
             store = urldetect.getDistroStore(guest, fetcher,
                     skip_error=has_location_kernel)
 
@@ -134,6 +138,10 @@ class InstallerTreeMedia(object):
             if has_location_kernel:
                 kernel_paths = [
                         (self._location_kernel, self._location_initrd)]
+            if has_location_kernel_from_iso:
+                kernel_paths.append([
+                    self._media.get_kernel_path(),
+                    self._media.get_initrd_path()])
 
             self._cached_data = _LocationData(os_variant, kernel_paths)
         return self._cached_data
-- 
2.20.1




More information about the virt-tools-list mailing list