Accepting request 518819 from Virtualization

Fix detecting SLE15 media for installations. Fix PV ISO installs.

OBS-URL: https://build.opensuse.org/request/show/518819
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/virt-manager?expand=0&rev=154
This commit is contained in:
Dominique Leuenberger 2017-08-28 13:16:51 +00:00 committed by Git OBS Bridge
commit f3eefcc1df
12 changed files with 145 additions and 15 deletions

View File

@ -0,0 +1,19 @@
Subject: urlfetcher: force binary mode with FTP servers (bz #1462838)
From: Cole Robinson crobinso@redhat.com Thu Aug 17 16:10:46 2017 -0400
Date: Thu Aug 17 16:10:46 2017 -0400:
Git: e902fa5550cc09538429b0fa828fb31aa2706d01
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index d04c78f..c60c77d 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -224,6 +224,8 @@ class _FTPURLFetcher(_URLFetcher):
self._ftp = ftplib.FTP()
self._ftp.connect(parsed.hostname, parsed.port)
self._ftp.login()
+ # Force binary mode
+ self._ftp.voidcmd("TYPE I")
except Exception as e:
raise ValueError(_("Opening URL %s failed: %s.") %
(self.location, str(e)))

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Fri Aug 25 15:09:50 MDT 2017 - carnold@suse.com
- bsc#1055787 - virt-install: With PV ISO installs guests will hang
on first reboot
virtinst-keep-install-iso-attached.patch
-------------------------------------------------------------------
Thu Aug 24 15:56:38 MDT 2017 - carnold@suse.com
- bsc#1054986 - Missing /media.1/products file on the ISO media
causes virt-install to fail detecting distro type and version
virtinst-add-sle15-detection-support.patch
-------------------------------------------------------------------
Tue Aug 22 08:05:07 MDT 2017 - carnold@suse.com
- Upstream bug fixes (bsc#1027942)
e902fa55-force-binary-mode-with-FTP-servers.patch
-------------------------------------------------------------------
Wed Aug 9 08:27:42 MDT 2017 - carnold@suse.com

View File

@ -38,6 +38,7 @@ Source1: virt-install.rb
Source2: virt-install.desktop
Source3: virt-manager-supportconfig
# Upstream Patches
Patch1: e902fa55-force-binary-mode-with-FTP-servers.patch
# SUSE Only
Patch70: virtman-desktop.patch
Patch71: virtman-kvm.patch
@ -78,6 +79,8 @@ Patch164: virtinst-use-qemu-for-cdrom-device.patch
Patch165: virtinst-fix-sle-distro-parsing.patch
Patch166: virtinst-check-date-format.patch
Patch167: virtinst-no-usb-tablet-for-xenpv.patch
Patch168: virtinst-add-sle15-detection-support.patch
Patch169: virtinst-keep-install-iso-attached.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -160,6 +163,7 @@ machine).
%prep
%setup -q
# Upstream Patches
%patch1 -p1
# SUSE Only
%patch70 -p1
%patch71 -p1
@ -200,6 +204,8 @@ machine).
%patch165 -p1
%patch166 -p1
%patch167 -p1
%patch168 -p1
%patch169 -p1
%build
%if %{qemu_user}

View File

@ -4,7 +4,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.2/virtinst/urlfetcher.py
@@ -464,6 +464,10 @@ def _distroFromSUSEContent(fetcher, arch
@@ -466,6 +466,10 @@ def _distroFromSUSEContent(fetcher, arch
dclass = SLESDistro
if distro_version is None:
distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[4]]
@ -15,7 +15,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
elif re.match(".*openSUSE.*", distribution[1]):
dclass = OpensuseDistro
if distro_version is None:
@@ -1026,7 +1030,8 @@ class SuseDistro(Distro):
@@ -1028,7 +1032,8 @@ class SuseDistro(Distro):
distro_version = self.version_from_content[1].strip()
version = distro_version.split('.', 1)[0].strip()
self.os_variant = self.urldistro
@ -25,7 +25,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
if self.os_variant.startswith(("sles", "sled")):
sp_version = None
if len(distro_version.split('.', 1)) == 2:
@@ -1040,6 +1045,8 @@ class SuseDistro(Distro):
@@ -1042,6 +1047,8 @@ class SuseDistro(Distro):
self.os_variant += "tumbleweed"
else:
self.os_variant += distro_version
@ -34,7 +34,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
else:
self.os_variant += "9"
@@ -1086,6 +1093,9 @@ class SLESDistro(SuseDistro):
@@ -1088,6 +1095,9 @@ class SLESDistro(SuseDistro):
class SLEDDistro(SuseDistro):
urldistro = "sled"

View File

@ -4,7 +4,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.2/virtinst/urlfetcher.py
@@ -438,6 +438,10 @@ def _distroFromSUSEContent(fetcher, arch
@@ -440,6 +440,10 @@ def _distroFromSUSEContent(fetcher, arch
arch = "i586"
elif cbuf.find("s390x") != -1:
arch = "s390x"
@ -15,7 +15,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
def _parse_sle_distribution(d):
sle_version = d[1].strip().rsplit(' ')[4]
@@ -996,10 +1000,12 @@ class SuseDistro(Distro):
@@ -998,10 +1002,12 @@ class SuseDistro(Distro):
oldkern += "64"
oldinit += "64"

View File

@ -0,0 +1,67 @@
References: bsc#1054986
With SLE15 and openSUSE 15 the content file has been removed from the media.
This file was used for SUSE distro version and arch detection. Now detection
must be done by parsing the media.1/products file for distro version and the
media.1/build file for the arch. The media.1/products and media.1/build files
have always been around so the entire _distroFromSUSEContent could be rewritten
(and simplified) to only check them. The products file format did change
between 11-SP4 and 12. SLE10 has no build file.
Index: virt-manager-1.4.2/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.2/virtinst/urlfetcher.py
@@ -392,7 +392,20 @@ def _distroFromSUSEContent(fetcher, arch
try:
cbuf = fetcher.acquireFileContent("content")
except ValueError:
- return None
+ try:
+ # If no content file, try media.1/products and media.1/build and create
+ # a cbuf with enough info for the content file parsing code below to work
+ pbuf = fetcher.acquireFileContent("media.1/products").rsplit('/', 1)[1].strip()
+ # Older style products format: SUSE-Linux-Enterprise-Server-11-SP4 11.4.4-1.109
+ # Newer style products format: SLES12-SP3 12.3-0
+ if pbuf.startswith('SLE'):
+ pbuf = pbuf.split(' ')[0]
+ pbuf = " ".join(re.split('(\d+)', pbuf, 1))
+ cbuf = "\nDISTRO ," + pbuf.replace('-', ' ')
+ bbuf = fetcher.acquireFileContent("media.1/build").split('-')
+ cbuf = cbuf + "\n" + " ".join(bbuf)
+ except ValueError:
+ return None
distribution = None
distro_version = None
@@ -465,7 +478,7 @@ def _distroFromSUSEContent(fetcher, arch
dclass = GenericDistro
if distribution:
if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \
- re.match(".*SUSE SLES*", distribution[1]):
+ re.match(".*SUSE SLES*", distribution[1]) or re.match("SLES*", distribution[1]):
dclass = SLESDistro
if distro_version is None:
distro_version = _parse_sle_distribution(distribution)
@@ -481,7 +494,7 @@ def _distroFromSUSEContent(fetcher, arch
dclass = CAASPDistro
if distro_version is None:
distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[6]]
- elif re.match(".*openSUSE.*", distribution[1]):
+ elif re.match(".*openSUSE.*", distribution[1]) or re.match("openSUSE *", distribution[1]):
dclass = OpensuseDistro
if distro_version is None:
distro_version = ['VERSION', distribution[0].strip().rsplit(':')[4]]
@@ -1040,8 +1053,11 @@ class SuseDistro(Distro):
self._xen_kernel_paths = [("boot/%s/vmlinuz-xenpae" % self.arch,
"boot/%s/initrd-xenpae" % self.arch)]
else:
- self._xen_kernel_paths = [("boot/%s/vmlinuz-xen" % self.arch,
- "boot/%s/initrd-xen" % self.arch)]
+ self._xen_kernel_paths = [("boot/%s/loader/linux" % self.arch,
+ "boot/%s/loader/initrd" % self.arch)]
+ # By appending this gets searched for first
+ self._xen_kernel_paths.append(("boot/%s/vmlinuz-xen" % self.arch,
+ "boot/%s/initrd-xen" % self.arch))
def _variantFromVersion(self):
distro_version = self.version_from_content[1].strip()

View File

@ -1,10 +1,10 @@
Enhancement to correctly detect Open Enterprise Server media is
selected as the installation source.
Index: virt-manager-1.4.0/virtinst/urlfetcher.py
Index: virt-manager-1.4.2/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.4.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.0/virtinst/urlfetcher.py
@@ -456,6 +456,10 @@ def _distroFromSUSEContent(fetcher, arch
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.2/virtinst/urlfetcher.py
@@ -458,6 +458,10 @@ def _distroFromSUSEContent(fetcher, arch
dclass = SLEDDistro
if distro_version is None:
distro_version = _parse_sle_distribution(distribution)

View File

@ -4,7 +4,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.2/virtinst/urlfetcher.py
@@ -444,9 +444,20 @@ def _distroFromSUSEContent(fetcher, arch
@@ -446,9 +446,20 @@ def _distroFromSUSEContent(fetcher, arch
arch = "ppc64le"
def _parse_sle_distribution(d):
@ -28,7 +28,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
return ['VERSION', sle_version]
dclass = GenericDistro
@@ -1034,7 +1045,10 @@ class SuseDistro(Distro):
@@ -1036,7 +1047,10 @@ class SuseDistro(Distro):
distro_version = self.version_from_content[1].strip()
version = distro_version.split('.', 1)[0].strip()
self.os_variant = self.urldistro

View File

@ -0,0 +1,18 @@
Older SLE guests have a two stage installation that need the ISO.
Newer SLE PV guests hang when a cdrom device is attached without
an ISO file.
Index: virt-manager-1.4.2/virtinst/guest.py
===================================================================
--- virt-manager-1.4.2.orig/virtinst/guest.py
+++ virt-manager-1.4.2/virtinst/guest.py
@@ -804,7 +804,8 @@ class Guest(XMLBuilder):
# install.
if (dev.is_cdrom() and
getattr(dev, "installer_media", False) and
- not self._os_object.is_windows()):
+ not self._os_object.is_windows() and
+ not self.os_variant.startswith(("sles", "sled", "opensuse"))):
dev.path = None
def _set_defaults(self):

View File

@ -57,7 +57,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
#########################################################################
@@ -301,7 +302,8 @@ class _MountedURLFetcher(_LocalURLFetche
@@ -303,7 +304,8 @@ class _MountedURLFetcher(_LocalURLFetche
logging.debug("Preparing mount at " + self._srcdir)
if self.location.startswith("nfs:"):

View File

@ -16,7 +16,7 @@ Index: virt-manager-1.4.2/virtinst/guest.py
+ if self.os.arch != 'x86_64' or os_ver.startswith("sles9") or \
+ os_ver.startswith("sles10") or os_ver.startswith("sled10") or \
+ os_ver.startswith("opensuse10") or os_ver.startswith("opensuse11"):
+ self.bootloader = "/usr/bin/pygrub"
+ self.bootloader = "pygrub"
+ self.os.clear()
+ else:
+ self.installer._install_kernel = "/usr/lib/grub2/x86_64-xen/grub.xen"

View File

@ -8,7 +8,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.2/virtinst/urlfetcher.py
@@ -1023,8 +1023,12 @@ class SuseDistro(Distro):
@@ -1025,8 +1025,12 @@ class SuseDistro(Distro):
"boot/%s/initrd" % self.arch))
# Matches Opensuse > 10.2 and sles 10