From 24c47c97a852190b06e79c3887ff67a84c8df136 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Mon, 28 Apr 2014 22:47:42 +0000 Subject: [PATCH] - Content file on media changed again. Update suse detection code. virtinst-detect-suse-distros.patch - bnc#874772 - virt-manager: Unable to complete install: 'xmlDesc in virDomainCreateXML must not be NULL' virtinst-pvgrub2-bootloader.patch - KVM: Use /usr/bin/qemu-system-x86_64 as the default emulator virtinst-set-qemu-emulator.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=168 --- virt-manager.changes | 15 ++++++++ virt-manager.spec | 1 + virtinst-detect-suse-distros.patch | 30 +++++++++------- virtinst-pvgrub2-bootloader.patch | 57 +++++++++++++++++++----------- virtinst-set-qemu-emulator.patch | 23 ++++++++---- 5 files changed, 85 insertions(+), 41 deletions(-) diff --git a/virt-manager.changes b/virt-manager.changes index ed7ec157..dea2d277 100644 --- a/virt-manager.changes +++ b/virt-manager.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Mon Apr 28 15:21:58 MDT 2014 - carnold@suse.com + +- Content file on media changed again. Update suse detection code. + virtinst-detect-suse-distros.patch + +------------------------------------------------------------------- +Thu Apr 24 16:52:58 MDT 2014 - carnold@suse.com + +- bnc#874772 - virt-manager: Unable to complete install: 'xmlDesc + in virDomainCreateXML must not be NULL' + virtinst-pvgrub2-bootloader.patch +- KVM: Use /usr/bin/qemu-system-x86_64 as the default emulator + virtinst-set-qemu-emulator.patch + ------------------------------------------------------------------- Tue Apr 22 09:31:58 MDT 2014 - carnold@suse.com diff --git a/virt-manager.spec b/virt-manager.spec index f1a73c03..09aec896 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + %define with_guestfs 0 %define askpass_package "openssh-askpass" %define qemu_user "qemu" diff --git a/virtinst-detect-suse-distros.patch b/virtinst-detect-suse-distros.patch index f247e7f1..73b9176e 100644 --- a/virtinst-detect-suse-distros.patch +++ b/virtinst-detect-suse-distros.patch @@ -2,7 +2,7 @@ Index: virt-manager-1.0.1/virtinst/urlfetcher.py =================================================================== --- virt-manager-1.0.1.orig/virtinst/urlfetcher.py +++ virt-manager-1.0.1/virtinst/urlfetcher.py -@@ -303,6 +303,81 @@ def _distroFromTreeinfo(fetcher, arch, v +@@ -303,6 +303,85 @@ def _distroFromTreeinfo(fetcher, arch, v return ob @@ -33,19 +33,24 @@ Index: virt-manager-1.0.1/virtinst/urlfetcher.py + for line in lines: + if line.startswith("LABEL "): + distribution = line.split(' ', 1) -+ if line.startswith("VERSION "): ++ elif line.startswith("DISTRO "): ++ distro_distro = line.rsplit(',', 1) ++ elif line.startswith("VERSION "): + distro_version = line.split(' ', 1) -+ if line.startswith("SUMMARY "): ++ elif line.startswith("SUMMARY "): + distro_summary = line.split(' ', 1) -+ if line.startswith("BASEARCHS "): ++ elif line.startswith("BASEARCHS "): + distro_arch = line.split(' ', 1) -+ if line.startswith("DEFAULTBASE "): ++ elif line.startswith("DEFAULTBASE "): + distro_arch = line.split(' ', 1) + if distribution and distro_version and distro_arch: + break + -+ if not distribution and distro_summary: -+ distribution = distro_summary ++ if not distribution: ++ if distro_summary: ++ distribution = distro_summary ++ elif distro_distro: ++ distribution = distro_distro + if distro_arch: + arch = distro_arch[1].strip() + else: @@ -56,6 +61,7 @@ Index: virt-manager-1.0.1/virtinst/urlfetcher.py + elif cbuf.find("s390x") != -1: + arch = "s390x" + ++ dclass = GenericDistro + if distribution: + if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \ + re.match(".*SUSE SLES*", distribution[1]): @@ -70,8 +76,6 @@ Index: virt-manager-1.0.1/virtinst/urlfetcher.py + dclass = OpensuseDistro + if distro_version is None: + distro_version = ['VERSION', '13.1'] -+ else: -+ dclass = GenericDistro + + ob = dclass(fetcher, arch, vmtype) + if dclass != GenericDistro: @@ -84,7 +88,7 @@ Index: virt-manager-1.0.1/virtinst/urlfetcher.py def getDistroStore(guest, fetcher): stores = [] -@@ -319,6 +394,10 @@ def getDistroStore(guest, fetcher): +@@ -319,6 +398,10 @@ def getDistroStore(guest, fetcher): if dist: return dist @@ -95,7 +99,7 @@ Index: virt-manager-1.0.1/virtinst/urlfetcher.py # FIXME: This 'distro ==' doesn't cut it. 'distro' is from our os # dictionary, so would look like 'fedora9' or 'rhel5', so this needs # to be a bit more intelligent -@@ -815,12 +894,11 @@ class SLDistro(RHELDistro): +@@ -815,12 +898,11 @@ class SLDistro(RHELDistro): class SuseDistro(Distro): name = "SUSE" @@ -109,7 +113,7 @@ Index: virt-manager-1.0.1/virtinst/urlfetcher.py Distro.__init__(self, *args, **kwargs) if re.match(r'i[4-9]86', self.arch): self.arch = 'i386' -@@ -831,22 +909,44 @@ class SuseDistro(Distro): +@@ -831,22 +913,44 @@ class SuseDistro(Distro): oldkern += "64" oldinit += "64" @@ -164,7 +168,7 @@ Index: virt-manager-1.0.1/virtinst/urlfetcher.py return True def _get_method_arg(self): -@@ -867,6 +967,27 @@ class SuseDistro(Distro): +@@ -867,6 +971,27 @@ class SuseDistro(Distro): return name return self.os_variant diff --git a/virtinst-pvgrub2-bootloader.patch b/virtinst-pvgrub2-bootloader.patch index aaa5428a..3cbc37fa 100644 --- a/virtinst-pvgrub2-bootloader.patch +++ b/virtinst-pvgrub2-bootloader.patch @@ -2,31 +2,46 @@ Index: virt-manager-1.0.1/virtinst/guest.py =================================================================== --- virt-manager-1.0.1.orig/virtinst/guest.py +++ virt-manager-1.0.1/virtinst/guest.py -@@ -331,7 +331,16 @@ class Guest(XMLBuilder): - this.) - @type disk_boot: C{bool} - """ -- osblob_install = install and not disk_boot -+ boot_pvgrub2 = False -+ if install == False and self.os.is_xenpv(): -+ os_ver = self._get_os_variant() -+ if os_ver == "sles12" or os_ver == "sled12": -+ boot_pvgrub2 = True -+ self.installer._install_kernel = "/usr/lib/grub2/x86_64-xen/grub.xen" -+ self.installer._install_initrd = None -+ self.installer.extraargs = None -+ logging.info("Using grub.xen to boot guest") -+ osblob_install = (install or boot_pvgrub2) and not disk_boot - if osblob_install and not self.installer.has_install_phase(): - return None - -@@ -348,7 +357,8 @@ class Guest(XMLBuilder): +@@ -348,8 +348,18 @@ class Guest(XMLBuilder): if (not install and self.os.is_xenpv() and not self.os.kernel): - self.bootloader = "/usr/bin/pygrub" -+ if boot_pvgrub2 is False: +- self.os.clear() ++ os_ver = self._get_os_variant() ++ if os_ver == "sles12" or os_ver == "sled12": ++ self.installer._install_kernel = "/usr/lib/grub2/x86_64-xen/grub.xen" ++ self.installer._install_initrd = None ++ self.installer.extraargs = None ++ # alter_bootconfig won't update the osxml unless it thinks ++ # we are in an install phase. Add force_update param to call ++ self.installer.alter_bootconfig(self, True, self.os, True) ++ logging.info("Using grub.xen to boot guest") ++ else: + self.bootloader = "/usr/bin/pygrub" - self.os.clear() ++ self.os.clear() return self.get_xml_config() + +Index: virt-manager-1.0.1/virtinst/installer.py +=================================================================== +--- virt-manager-1.0.1.orig/virtinst/installer.py ++++ virt-manager-1.0.1/virtinst/installer.py +@@ -111,7 +111,7 @@ class Installer(object): + dev.validate() + return dev + +- def alter_bootconfig(self, guest, isinstall, bootconfig): ++ def alter_bootconfig(self, guest, isinstall, bootconfig, force_update=False): + """ + Generate the portion of the guest xml that determines boot devices + and parameters. (typically the block) +@@ -122,7 +122,7 @@ class Installer(object): + 'post-install' phase. + @type isinstall: C{bool} + """ +- if isinstall and not self.has_install_phase(): ++ if isinstall and not force_update and not self.has_install_phase(): + return + + bootorder = self._build_boot_order(isinstall, guest) diff --git a/virtinst-set-qemu-emulator.patch b/virtinst-set-qemu-emulator.patch index a473b24b..d416acea 100644 --- a/virtinst-set-qemu-emulator.patch +++ b/virtinst-set-qemu-emulator.patch @@ -10,20 +10,29 @@ Index: virt-manager-1.0.1/virtinst/guest.py import logging import urlgrabber.progress as progress -@@ -724,12 +725,13 @@ class Guest(XMLBuilder): +@@ -724,14 +725,19 @@ class Guest(XMLBuilder): self.emulator = None return - if self.emulator: -+ preferred_emulator = "/usr/lib/xen/bin/qemu-system-i386" ++ if self.conn.is_qemu(): ++ preferred_emulator = "/usr/bin/qemu-system-x86_64" ++ else: ++ preferred_emulator = "/usr/lib/xen/bin/qemu-system-i386" + if self.emulator and self.emulator == preferred_emulator: return - if self.os.is_hvm() and self.type == "xen": +- if self.os.is_hvm() and self.type == "xen": - if self.conn.caps.host.cpu.arch == "x86_64": - self.emulator = "/usr/lib64/xen/bin/qemu-dm" -+ if os.path.exists(preferred_emulator): -+ self.emulator = preferred_emulator - else: - self.emulator = "/usr/lib/xen/bin/qemu-dm" +- else: +- self.emulator = "/usr/lib/xen/bin/qemu-dm" ++ if os.path.exists(preferred_emulator): ++ self.emulator = preferred_emulator ++ elif self.os.is_hvm() and self.type == "xen": ++ self.emulator = "/usr/lib/xen/bin/qemu-dm" ++ else: ++ self.emulator = "/usr/bin/qemu-kvm" + def _set_cpu_defaults(self): + self.cpu.set_topology_defaults(self.vcpus)