* [PATCH] tools/pygrub: fix solaris kernel sniff
@ 2011-07-08 4:19 Zhigang Wang
2011-07-08 17:16 ` Ian Jackson
0 siblings, 1 reply; 4+ messages in thread
From: Zhigang Wang @ 2011-07-08 4:19 UTC (permalink / raw)
To: xen-devel; +Cc: kurt.hackel, zhigang.x.wang, frank.che
# HG changeset patch
# User Zhigang Wang <zhigang.x.wang@oracle.com>
# Date 1310098767 14400
# Node ID b579db4d7232b6541cdb1c5ed1dc01b41705d3d4
# Parent 2f63562df1c4230492a81793dce3672f93c93d9a
tools/pygrub: fix solaris kernel sniff
Solaris 11 build 163+ removes '/platform/i86xpv/kernel/unix' and only the
64-bit PV kernel file '/platform/i86xpv/kernel/amd64/unix' exists.
This patch fixes the detection.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Frank Che <frank.che@oracle.com>
diff -r 2f63562df1c4 -r b579db4d7232 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub Mon Jun 27 17:37:12 2011 +0100
+++ b/tools/pygrub/src/pygrub Fri Jul 08 00:19:27 2011 -0400
@@ -594,17 +594,16 @@ def supports64bitPVguest():
# 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
-
if not cfg["kernel"]:
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:
+ elif fs.file_exists("/platform/i86xpv/kernel/unix"):
cfg["kernel"] = "/platform/i86xpv/kernel/unix"
cfg["ramdisk"] = "/platform/i86pc/boot_archive"
+ else:
+ return cfg
# 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tools/pygrub: fix solaris kernel sniff
2011-07-08 4:19 [PATCH] tools/pygrub: fix solaris kernel sniff Zhigang Wang
@ 2011-07-08 17:16 ` Ian Jackson
2011-07-08 18:45 ` Zhigang Wang
0 siblings, 1 reply; 4+ messages in thread
From: Ian Jackson @ 2011-07-08 17:16 UTC (permalink / raw)
To: Zhigang Wang; +Cc: kurt.hackel, xen-devel, frank.che
Zhigang Wang writes ("[Xen-devel] [PATCH] tools/pygrub: fix solaris kernel sniff"):
> tools/pygrub: fix solaris kernel sniff
>
> Solaris 11 build 163+ removes '/platform/i86xpv/kernel/unix' and only the
> 64-bit PV kernel file '/platform/i86xpv/kernel/amd64/unix' exists.
Thanks but I'm not sure this is right.
Previously, if none of the Solaris files in /platform exist, this code
would unconditionally exit.
Now you have moved the relevant return inside the
if not cfg["kernel"]:
so that on a non-Solaris platform if cfg["kernel"] is not set we will
always do the "Unpleasant" tweaks.
I don't think that's correct.
Ian.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tools/pygrub: fix solaris kernel sniff
2011-07-08 17:16 ` Ian Jackson
@ 2011-07-08 18:45 ` Zhigang Wang
2011-07-14 17:10 ` Ian Jackson
0 siblings, 1 reply; 4+ messages in thread
From: Zhigang Wang @ 2011-07-08 18:45 UTC (permalink / raw)
To: Ian Jackson; +Cc: kurt.hackel, xen-devel, frank.che
[-- Attachment #1: Type: text/plain, Size: 751 bytes --]
On 07/08/2011 01:16 PM, Ian Jackson wrote:
> Zhigang Wang writes ("[Xen-devel] [PATCH] tools/pygrub: fix solaris kernel sniff"):
>> tools/pygrub: fix solaris kernel sniff
>>
>> Solaris 11 build 163+ removes '/platform/i86xpv/kernel/unix' and only the
>> 64-bit PV kernel file '/platform/i86xpv/kernel/amd64/unix' exists.
> Thanks but I'm not sure this is right.
>
> Previously, if none of the Solaris files in /platform exist, this code
> would unconditionally exit.
>
> Now you have moved the relevant return inside the
> if not cfg["kernel"]:
> so that on a non-Solaris platform if cfg["kernel"] is not set we will
> always do the "Unpleasant" tweaks.
>
> I don't think that's correct.
>
> Ian.
Yes. I agree.
What about attached patch?
zhigang
[-- Attachment #2: xen-pygrub-fix-solaris-kernel-sniff --]
[-- Type: text/plain, Size: 1672 bytes --]
# HG changeset patch
# Parent 2f63562df1c4230492a81793dce3672f93c93d9a
tools/pygrub: fix solaris kernel sniff
Solaris 11 build 163+ removes '/platform/i86xpv/kernel/unix' and only the
64-bit PV kernel file '/platform/i86xpv/kernel/amd64/unix' exists.
This patch fixes the detection.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Frank Che <frank.che@oracle.com>
diff -r 2f63562df1c4 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub Mon Jun 27 17:37:12 2011 +0100
+++ b/tools/pygrub/src/pygrub Fri Jul 08 14:42:16 2011 -0400
@@ -594,7 +594,8 @@ def supports64bitPVguest():
# 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"):
+ if not fs.file_exists("/platform/i86xpv/kernel/unix") and \
+ not fs.file_exists("/platform/i86xpv/kernel/amd64/unix"):
return cfg
if not cfg["kernel"]:
@@ -602,9 +603,11 @@ def sniff_solaris(fs, cfg):
fs.file_exists("/platform/i86xpv/kernel/amd64/unix"):
cfg["kernel"] = "/platform/i86xpv/kernel/amd64/unix"
cfg["ramdisk"] = "/platform/i86pc/amd64/boot_archive"
- else:
+ elif fs.file_exists("/platform/i86xpv/kernel/unix"):
cfg["kernel"] = "/platform/i86xpv/kernel/unix"
cfg["ramdisk"] = "/platform/i86pc/boot_archive"
+ else:
+ return cfg
# 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
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tools/pygrub: fix solaris kernel sniff
2011-07-08 18:45 ` Zhigang Wang
@ 2011-07-14 17:10 ` Ian Jackson
0 siblings, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2011-07-14 17:10 UTC (permalink / raw)
To: Zhigang Wang; +Cc: kurt.hackel, xen-devel, frank.che
Zhigang Wang writes ("Re: [Xen-devel] [PATCH] tools/pygrub: fix solaris kernel sniff"):
> What about attached patch?
Looks good, I have applied it, thanks.
Ian.
> ----------------------------------------------------------------------
> # HG changeset patch
> # Parent 2f63562df1c4230492a81793dce3672f93c93d9a
> tools/pygrub: fix solaris kernel sniff
>
> Solaris 11 build 163+ removes '/platform/i86xpv/kernel/unix' and only the
> 64-bit PV kernel file '/platform/i86xpv/kernel/amd64/unix' exists.
>
> This patch fixes the detection.
>
> Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
> Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
> Signed-off-by: Frank Che <frank.che@oracle.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-14 17:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-08 4:19 [PATCH] tools/pygrub: fix solaris kernel sniff Zhigang Wang
2011-07-08 17:16 ` Ian Jackson
2011-07-08 18:45 ` Zhigang Wang
2011-07-14 17:10 ` Ian Jackson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.