Accepting request 379050 from Virtualization

A few fixes for Tumbleweed

OBS-URL: https://build.opensuse.org/request/show/379050
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/virt-manager?expand=0&rev=137
This commit is contained in:
Dominique Leuenberger 2016-03-26 14:28:15 +00:00 committed by Git OBS Bridge
commit ab6de75cce
9 changed files with 166 additions and 39 deletions

View File

@ -1,13 +1,56 @@
References: bnc#934270 References: bnc#934270
We don't ship unar with any suse distro (not even in Factory).
Until we do, keep this patch to execute the correct archiver
program.
Index: virt-manager-1.3.2/virtconv/formats.py Subject: Replace the unar to more common archivers
=================================================================== From: Lin Ma lma@suse.com Wed Jan 6 12:22:57 2016 +0800
--- virt-manager-1.3.2.orig/virtconv/formats.py Date: Sun Jan 10 18:23:29 2016 -0500:
+++ virt-manager-1.3.2/virtconv/formats.py Git: 21fd079eb19899cf5283c6a55e9006d1fa0619b9
@@ -118,6 +118,8 @@ def _find_input(input_file, parser, prin
Because some of distributions dont provide the unar (universal archiver),
Using more common archivers to replace it.
Signed-off-by: Lin Ma <lma@suse.com>
(crobinso: adjust test suite)
diff --git a/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt b/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
index b03ca3c..b046c66 100644
--- a/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
+++ b/tests/virtconv-files/libvirt_output/vmx2libvirt_test-vmx-zip.libvirt
@@ -73,5 +73,5 @@
</domain>
-test-vmx-zip.zip appears to be an archive, running: unar -o /var/tmp/virt-convert-tmp test-vmx-zip.zip
+test-vmx-zip.zip appears to be an archive, running: unzip -o -d /var/tmp/virt-convert-tmp /home/crobinso/src/virt-manager/tests/virtconv-files/vmx_input/test-vmx-zip.zip
Copying MS-DOS.vmdk to /var/lib/libvirt/images/MS-DOS
diff --git a/tests/virtconvtest.py b/tests/virtconvtest.py
index 7f1c735..622117f 100644
--- a/tests/virtconvtest.py
+++ b/tests/virtconvtest.py
@@ -15,7 +15,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
-from distutils.spawn import find_executable
import glob
import os
import StringIO
@@ -66,10 +65,6 @@ class TestVirtConv(unittest.TestCase):
if disk_format:
out_path += ".disk_%s" % disk_format
- if (os.path.splitext(in_path)[1] in [".zip"] and
- not find_executable("unar")):
- self.skipTest("Install 'unar' to run all tests.")
-
try:
os.chdir(os.path.dirname(in_path))
self._convert_helper(in_path, out_path, in_type, disk_format)
diff --git a/virtconv/formats.py b/virtconv/formats.py
index 9a6d237..ed8a66e 100644
--- a/virtconv/formats.py
+++ b/virtconv/formats.py
@@ -118,6 +118,8 @@ def _find_input(input_file, parser, print_cb):
try: try:
ext = os.path.splitext(input_file)[1] ext = os.path.splitext(input_file)[1]
tempdir = None tempdir = None
@ -16,7 +59,7 @@ Index: virt-manager-1.3.2/virtconv/formats.py
if ext and ext[1:] in ["zip", "gz", "ova", if ext and ext[1:] in ["zip", "gz", "ova",
"tar", "bz2", "bzip2", "7z", "xz"]: "tar", "bz2", "bzip2", "7z", "xz"]:
basedir = "/var/tmp" basedir = "/var/tmp"
@@ -129,19 +131,40 @@ def _find_input(input_file, parser, prin @@ -129,19 +131,40 @@ def _find_input(input_file, parser, print_cb):
base = os.path.basename(input_file) base = os.path.basename(input_file)

View File

@ -0,0 +1,53 @@
References: fate#320353
Subject: virt-convert: decompress the .gz files before converting
From: Lin Ma lma@suse.com Mon Mar 7 18:39:23 2016 +0800
Date: Wed Mar 9 20:06:16 2016 -0500:
Git: f11eb00b9a630b7b8dbd9ad2ed7333b7a5303fd2
The OVF specification v1.1.0(page 15) indicates that "Each file
referenced by a File element may be compressed using gzip
(see RFC1952)."
In this case the .gz files should be decompressed first before
converting through qemu-img.
Signed-off-by: Lin Ma <lma@suse.com>
Index: virt-manager-1.3.2/virtconv/formats.py
===================================================================
--- virt-manager-1.3.2.orig/virtconv/formats.py
+++ virt-manager-1.3.2/virtconv/formats.py
@@ -263,6 +263,8 @@ class VirtConverter(object):
"""
binnames = ["qemu-img", "kvm-img"]
+ decompress_cmd = None
+
if _is_test():
executable = "/usr/bin/qemu-img"
else:
@@ -275,12 +277,23 @@ class VirtConverter(object):
raise RuntimeError(_("None of %s tools found.") % binnames)
base = os.path.basename(absin)
+ ext = os.path.splitext(base)[1]
+ if (ext and ext[1:] == "gz"):
+ if not find_executable("gzip"):
+ raise RuntimeError("'gzip' is needed to decompress the file, "
+ "but not found.")
+ decompress_cmd = ["gzip", "-d", absin]
+ base = os.path.splitext(base)[0]
+ absin = absin[0:-3]
+ self.print_cb("Running %s" % " ".join(decompress_cmd))
cmd = [executable, "convert", "-O", disk_format, base, absout]
self.print_cb("Running %s" % " ".join(cmd))
if dry:
return
cmd[4] = absin
+ if decompress_cmd is not None:
+ _run_cmd(decompress_cmd)
_run_cmd(cmd)
def convert_disks(self, disk_format, destdir=None, dry=False):

View File

@ -1,3 +1,31 @@
-------------------------------------------------------------------
Wed Mar 23 13:02:36 MDT 2016 - carnold@suse.com
- Replace virtinst-replace-unar-with-other-archivers.patch with the
upstream version
21fd079e-replace-unar-with-other-archivers.patch
-------------------------------------------------------------------
Fri Mar 18 15:03:06 MDT 2016 - carnold@suse.com
- bsc#971825 - virt-manager needs to use grub.xen installing a PV
Tumbleweed VM
virtinst-pvgrub2-bootloader.patch
-------------------------------------------------------------------
Fri Mar 11 08:11:21 MST 2016 - lma@suse.com
- fate#320353 - Add the ability for virt-convirt to decompress
compressed files in an OVA
f11eb00b-virt-convert-decompress-gz-files-before-converting.patch
-------------------------------------------------------------------
Wed Mar 9 13:20:36 MST 2016 - carnold@suse.com
- bsc#951726 - Error - 'wrong number of arguments (3 for 1) ...'
when attempting to create DomU through the yast
virt-manager.spec
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Feb 2 14:08:43 MST 2016 - carnold@suse.com Tue Feb 2 14:08:43 MST 2016 - carnold@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package virt-manager # spec file for package virt-manager
# #
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -38,8 +38,10 @@ Source1: virt-install.rb
Source2: virt-install.desktop Source2: virt-install.desktop
# Upstream Patches # Upstream Patches
Patch1: 89c3638b-fix-detection-that-libvirtd-is-stopped.patch Patch1: 89c3638b-fix-detection-that-libvirtd-is-stopped.patch
Patch2: eae7dc06-fix-URL-installs-when-content-length-header-missing.patch Patch2: 21fd079e-replace-unar-with-other-archivers.patch
Patch3: 1c221fd0-suse-ovmf-paths.patch Patch3: eae7dc06-fix-URL-installs-when-content-length-header-missing.patch
Patch4: 1c221fd0-suse-ovmf-paths.patch
Patch5: f11eb00b-virt-convert-decompress-gz-files-before-converting.patch
# SUSE Only # SUSE Only
Patch70: virtman-desktop.patch Patch70: virtman-desktop.patch
Patch71: virtman-kvm.patch Patch71: virtman-kvm.patch
@ -75,9 +77,8 @@ Patch154: virtman-allow-creating-i686-vm.patch
Patch160: virtinst-xen-drive-type.patch Patch160: virtinst-xen-drive-type.patch
Patch161: virtinst-xenbus-disk-index-fix.patch Patch161: virtinst-xenbus-disk-index-fix.patch
Patch162: virtinst-refresh_before_fetch_pool.patch Patch162: virtinst-refresh_before_fetch_pool.patch
Patch163: virtinst-replace-unar-with-other-archivers.patch Patch163: virtinst-fix-sle12sp1-detection.patch
Patch164: virtinst-fix-sle12sp1-detection.patch Patch164: virtinst-fix-tumbleweed-detection.patch
Patch165: virtinst-fix-tumbleweed-detection.patch
BuildArch: noarch BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -160,6 +161,8 @@ machine).
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1
%patch5 -p1
# SUSE Only # SUSE Only
%patch70 -p1 %patch70 -p1
%patch71 -p1 %patch71 -p1
@ -197,7 +200,6 @@ machine).
%patch162 -p1 %patch162 -p1
%patch163 -p1 %patch163 -p1
%patch164 -p1 %patch164 -p1
%patch165 -p1
%build %build
%if %{qemu_user} %if %{qemu_user}
@ -284,6 +286,7 @@ fi
%{_datadir}/appdata/%{name}.appdata.xml %{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop %{_datadir}/applications/%{name}.desktop
%{_datadir}/applications/YaST2/virt-install.desktop
%{_datadir}/glib-2.0/schemas/org.virt-manager.virt-manager.gschema.xml %{_datadir}/glib-2.0/schemas/org.virt-manager.virt-manager.gschema.xml
%{_datadir}/GConf/gsettings/org.virt-manager.virt-manager.convert %{_datadir}/GConf/gsettings/org.virt-manager.virt-manager.convert
@ -313,7 +316,6 @@ fi
%dir %{_datadir}/GConf/gsettings %dir %{_datadir}/GConf/gsettings
%dir %{_datadir}/appdata %dir %{_datadir}/appdata
%{_datadir}/YaST2/clients/virt-install.rb %{_datadir}/YaST2/clients/virt-install.rb
%{_datadir}/applications/YaST2/virt-install.desktop
%{_bindir}/virt-install %{_bindir}/virt-install
%{_bindir}/virt-clone %{_bindir}/virt-clone

View File

@ -1,9 +1,9 @@
References: bnc#885308 References: bnc#885308
Enhancement to add a virtio RNG device to non windows VMs. Enhancement to add a virtio RNG device to non windows VMs.
Index: virt-manager-1.3.0/virtinst/guest.py Index: virt-manager-1.3.2/virtinst/guest.py
=================================================================== ===================================================================
--- virt-manager-1.3.0.orig/virtinst/guest.py --- virt-manager-1.3.2.orig/virtinst/guest.py
+++ virt-manager-1.3.0/virtinst/guest.py +++ virt-manager-1.3.2/virtinst/guest.py
@@ -54,6 +54,7 @@ from .pm import PM @@ -54,6 +54,7 @@ from .pm import PM
from .seclabel import Seclabel from .seclabel import Seclabel
from .xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty from .xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty
@ -12,7 +12,7 @@ Index: virt-manager-1.3.0/virtinst/guest.py
class Guest(XMLBuilder): class Guest(XMLBuilder):
@@ -711,6 +712,15 @@ class Guest(XMLBuilder): @@ -712,6 +713,15 @@ class Guest(XMLBuilder):
return return
self.add_device(VirtualGraphics(self.conn)) self.add_device(VirtualGraphics(self.conn))
@ -28,7 +28,7 @@ Index: virt-manager-1.3.0/virtinst/guest.py
def add_default_devices(self): def add_default_devices(self):
self.add_default_graphics() self.add_default_graphics()
self.add_default_video_device() self.add_default_video_device()
@@ -718,6 +728,7 @@ class Guest(XMLBuilder): @@ -719,6 +729,7 @@ class Guest(XMLBuilder):
self.add_default_console_device() self.add_default_console_device()
self.add_default_usb_controller() self.add_default_usb_controller()
self.add_default_channels() self.add_default_channels()

View File

@ -2,11 +2,11 @@ Reference: bnc#863821
grub.xen is required to boot PV VMs that use the BTRFS filesystem. grub.xen is required to boot PV VMs that use the BTRFS filesystem.
This patch forces the use of grub.xen (instead of using pygrub) for This patch forces the use of grub.xen (instead of using pygrub) for
newer suse distros like SLE12 and openSUSE 13.2. newer suse distros like SLE12 and openSUSE 13.2.
Index: virt-manager-1.3.0/virtinst/guest.py Index: virt-manager-1.3.2/virtinst/guest.py
=================================================================== ===================================================================
--- virt-manager-1.3.0.orig/virtinst/guest.py --- virt-manager-1.3.2.orig/virtinst/guest.py
+++ virt-manager-1.3.0/virtinst/guest.py +++ virt-manager-1.3.2/virtinst/guest.py
@@ -365,8 +365,19 @@ class Guest(XMLBuilder): @@ -365,8 +365,20 @@ class Guest(XMLBuilder):
if (not install and if (not install and
self.os.is_xenpv() and self.os.is_xenpv() and
not self.os.kernel): not self.os.kernel):
@ -14,7 +14,8 @@ Index: virt-manager-1.3.0/virtinst/guest.py
- self.os.clear() - self.os.clear()
+ os_ver = self._get_os_variant() + os_ver = self._get_os_variant()
+ if os_ver.startswith("sles12") or os_ver.startswith("sled12") or \ + if os_ver.startswith("sles12") or os_ver.startswith("sled12") or \
+ os_ver.startswith("opensuse13") or os_ver.startswith("opensuse42"): + os_ver.startswith("opensuse13") or os_ver.startswith("opensuse42") or \
+ os_ver.startswith("opensuse-tumbleweed"):
+ self.installer._install_kernel = "/usr/lib/grub2/x86_64-xen/grub.xen" + self.installer._install_kernel = "/usr/lib/grub2/x86_64-xen/grub.xen"
+ self.installer._install_initrd = None + self.installer._install_initrd = None
+ self.installer.extraargs = None + self.installer.extraargs = None
@ -28,10 +29,10 @@ Index: virt-manager-1.3.0/virtinst/guest.py
return self.get_xml_config() return self.get_xml_config()
Index: virt-manager-1.3.0/virtinst/installer.py Index: virt-manager-1.3.2/virtinst/installer.py
=================================================================== ===================================================================
--- virt-manager-1.3.0.orig/virtinst/installer.py --- virt-manager-1.3.2.orig/virtinst/installer.py
+++ virt-manager-1.3.0/virtinst/installer.py +++ virt-manager-1.3.2/virtinst/installer.py
@@ -99,7 +99,7 @@ class Installer(object): @@ -99,7 +99,7 @@ class Installer(object):
break break
return bootorder return bootorder

View File

@ -16,7 +16,7 @@ Index: virt-manager-1.3.2/virtinst/guest.py
self.x86_cpu_default = self.cpu.SPECIAL_MODE_HOST_MODEL_ONLY self.x86_cpu_default = self.cpu.SPECIAL_MODE_HOST_MODEL_ONLY
self.__os_object = None self.__os_object = None
@@ -662,7 +665,7 @@ class Guest(XMLBuilder): @@ -663,7 +666,7 @@ class Guest(XMLBuilder):
self.add_device(dev) self.add_device(dev)
def add_default_video_device(self): def add_default_video_device(self):
@ -25,7 +25,7 @@ Index: virt-manager-1.3.2/virtinst/guest.py
return return
if self.get_devices("video"): if self.get_devices("video"):
return return
@@ -700,6 +703,8 @@ class Guest(XMLBuilder): @@ -701,6 +704,8 @@ class Guest(XMLBuilder):
dev.target_type = "virtio" dev.target_type = "virtio"
dev.target_name = dev.CHANNEL_NAME_QEMUGA dev.target_name = dev.CHANNEL_NAME_QEMUGA
self.add_device(dev) self.add_device(dev)
@ -34,7 +34,7 @@ Index: virt-manager-1.3.2/virtinst/guest.py
def add_default_graphics(self): def add_default_graphics(self):
if self.skip_default_graphics: if self.skip_default_graphics:
@@ -708,7 +713,7 @@ class Guest(XMLBuilder): @@ -709,7 +714,7 @@ class Guest(XMLBuilder):
return return
if self.os.is_container(): if self.os.is_container():
return return
@ -43,7 +43,7 @@ Index: virt-manager-1.3.2/virtinst/guest.py
return return
self.add_device(VirtualGraphics(self.conn)) self.add_device(VirtualGraphics(self.conn))
@@ -1034,7 +1039,7 @@ class Guest(XMLBuilder): @@ -1035,7 +1040,7 @@ class Guest(XMLBuilder):
if self._hv_only_supports_virtio(): if self._hv_only_supports_virtio():
return True return True

View File

@ -1,9 +1,9 @@
Set cache mode for target installation disk to unsafe for better Set cache mode for target installation disk to unsafe for better
performance. performance.
Index: virt-manager-1.3.0/virtinst/guest.py Index: virt-manager-1.3.2/virtinst/guest.py
=================================================================== ===================================================================
--- virt-manager-1.3.0.orig/virtinst/guest.py --- virt-manager-1.3.2.orig/virtinst/guest.py
+++ virt-manager-1.3.0/virtinst/guest.py +++ virt-manager-1.3.2/virtinst/guest.py
@@ -53,6 +53,7 @@ from .osxml import OSXML @@ -53,6 +53,7 @@ from .osxml import OSXML
from .pm import PM from .pm import PM
from .seclabel import Seclabel from .seclabel import Seclabel
@ -30,7 +30,7 @@ Index: virt-manager-1.3.0/virtinst/guest.py
self.bootloader = None self.bootloader = None
if (not install and if (not install and
self.os.is_xenpv() and self.os.is_xenpv() and
@@ -379,7 +391,10 @@ class Guest(XMLBuilder): @@ -380,7 +392,10 @@ class Guest(XMLBuilder):
self.bootloader = "/usr/bin/pygrub" self.bootloader = "/usr/bin/pygrub"
self.os.clear() self.os.clear()

View File

@ -5,7 +5,7 @@ Index: virt-manager-1.3.2/virtinst/guest.py
=================================================================== ===================================================================
--- virt-manager-1.3.2.orig/virtinst/guest.py --- virt-manager-1.3.2.orig/virtinst/guest.py
+++ virt-manager-1.3.2/virtinst/guest.py +++ virt-manager-1.3.2/virtinst/guest.py
@@ -849,14 +849,11 @@ class Guest(XMLBuilder): @@ -850,14 +850,11 @@ class Guest(XMLBuilder):
self.emulator = None self.emulator = None
return return