File virtinst-change-location-for-grub_xen.patch of Package virt-manager

References: fate#326960, bsc#1123942

Index: virt-manager-4.1.0/virtinst/install/installer.py
===================================================================
--- virt-manager-4.1.0.orig/virtinst/install/installer.py
+++ virt-manager-4.1.0/virtinst/install/installer.py
@@ -592,7 +592,10 @@ class Installer(object):
                 guest.bootloader = "pygrub"
             else:
                 guest.bootloader = None
-                self._treemedia_bootconfig = ("/usr/lib/grub2/x86_64-xen/grub.xen", "", "")
+                if os.path.exists("/usr/share/grub2/x86_64-xen/grub.xen"):
+                    self._treemedia_bootconfig = ("/usr/share/grub2/x86_64-xen/grub.xen", "", "")
+                else:
+                    self._treemedia_bootconfig = ("/usr/lib/grub2/x86_64-xen/grub.xen", "", "")
                 log.debug("Using grub.xen to boot guest")
                 on_reboot_value = guest.on_reboot
                 self._alter_bootconfig(guest)
Index: virt-manager-4.1.0/virtManager/delete.py
===================================================================
--- virt-manager-4.1.0.orig/virtManager/delete.py
+++ virt-manager-4.1.0/virtManager/delete.py
@@ -459,7 +459,7 @@ def _populate_storage_list(storage_list,
     model.clear()
 
     for diskdata in diskdatas:
-        if not diskdata.path or diskdata.path == "/usr/lib/grub2/x86_64-xen/grub.xen":
+        if not diskdata.path or "grub.xen" in diskdata.path:
             continue
 
         # There are a few pieces here
openSUSE Build Service is sponsored by