virt-manager/virtinst-pvgrub2-bootloader.patch

30 lines
1.4 KiB
Diff

Reference: bnc#863821
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
suse distros SLE12GA, openSUSE 13.2, and newer.
Index: virt-manager-2.1.0/virtinst/installer.py
===================================================================
--- virt-manager-2.1.0.orig/virtinst/installer.py
+++ virt-manager-2.1.0/virtinst/installer.py
@@ -303,6 +303,20 @@ class Installer(object):
install_xml = None
if self.has_install_phase():
install_xml = self._get_install_xml(guest)
+ if (guest.os.is_xenpv() and
+ not guest.os.kernel):
+ os_ver = guest.osinfo.name
+ if guest.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"):
+ guest.bootloader = "pygrub"
+ else:
+ guest.bootloader = None
+ self._install_kernel = "/usr/lib/grub2/x86_64-xen/grub.xen"
+ self._install_initrd = None
+ self.extraargs = None
+ logging.info("Using grub.xen to boot guest")
+ self._alter_bootconfig(guest)
final_xml = guest.get_xml()
logging.debug("Generated install XML: %s",