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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux