WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] pygrub: fix 64b Solaris PV guest boot on

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] pygrub: fix 64b Solaris PV guest boot on 32b Linux dom0 & 64b Xen
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Apr 2010 14:55:10 -0700
Delivery-date: Tue, 13 Apr 2010 14:57:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1271053304 -3600
# Node ID 5bc70100b514d98bd3938cdeca1e182726c26df2
# Parent  aae7cb2f18411492c720d3b60adaa979858a63df
pygrub: fix 64b Solaris PV guest boot on 32b Linux dom0 & 64b Xen

Signed-off-by: Mark Johnson <mark.r.johnson@xxxxxxxxxx>
---
 tools/pygrub/src/pygrub |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff -r aae7cb2f1841 -r 5bc70100b514 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub   Fri Apr 09 08:54:25 2010 +0100
+++ b/tools/pygrub/src/pygrub   Mon Apr 12 07:21:44 2010 +0100
@@ -17,6 +17,7 @@ import copy
 import copy
 import logging
 import platform
+import xen.lowlevel.xc
 
 import curses, _curses, curses.wrapper, curses.textpad, curses.ascii
 import getopt
@@ -573,27 +574,28 @@ def run_grub(file, entry, fs, arg):
 
     return grubcfg
 
+def supports64bitPVguest():
+    xc = xen.lowlevel.xc.xc()
+    caps = xc.xeninfo()['xen_caps'].split(" ")
+    for cap in caps:
+        if cap == "xen-3.0-x86_64":
+            return True
+    return False
+
 # If nothing has been specified, look for a Solaris domU. If found, perform the
 # necessary tweaks.
 def sniff_solaris(fs, cfg):
     if not fs.file_exists("/platform/i86xpv/kernel/unix"):
         return cfg
-    
-    # darned python
-    longmode = (sys.maxint != 2147483647L)
-    if not longmode:
-        longmode = os.uname()[4] == "x86_64"
-    if not longmode:
-        if (os.access("/usr/bin/isainfo", os.R_OK) and
-            os.popen("/usr/bin/isainfo -b").read() == "64\n"):
-            longmode = True
 
     if not cfg["kernel"]:
-        cfg["kernel"] = "/platform/i86xpv/kernel/unix"
-        cfg["ramdisk"] = "/platform/i86pc/boot_archive"
-        if longmode:
+        if supports64bitPVguest() and \
+          fs.file_exists("/platform/i86xpv/kernel/amd64/unix"):
             cfg["kernel"] = "/platform/i86xpv/kernel/amd64/unix"
             cfg["ramdisk"] = "/platform/i86pc/amd64/boot_archive"
+        else:
+            cfg["kernel"] = "/platform/i86xpv/kernel/unix"
+            cfg["ramdisk"] = "/platform/i86pc/boot_archive"
 
     # Unpleasant. Typically we'll have 'root=foo -k' or 'root=foo /kernel -k',
     # and we need to maintain Xen properties (root= and ip=) and the kernel

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] pygrub: fix 64b Solaris PV guest boot on 32b Linux dom0 & 64b Xen, Xen patchbot-unstable <=