All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yu Zhiguo <yuzg@cn.fujitsu.com>
To: Ian Campbell <Ian.Campbell@eu.citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: [PATCH] xm: needless to check 'kernel/ramdisk' is existent or not
Date: Thu, 15 Jul 2010 10:37:51 +0800	[thread overview]
Message-ID: <4C3E747F.9050208@cn.fujitsu.com> (raw)
In-Reply-To: <1279110833.5872.12.camel@zakaz.uk.xensource.com>

Hi,

Ian Campbell wrote:
>> xl now cannot use 'bootloader' format (before your patchs),
>> it just use 'kernel + ramdisk' format, so it should check 'kernel'
>> is existent in Dom0 or not.
>>
>> But xm can use 'bootloader' format, in this format, 'kernel' should not be
>> check in Dom0 because it is path in DomU.
> 
> Correct.
> 

Just ignore path check of kernel if bootloader is specified can fix this problem.
Please refer to this patch.

Yu
------------

When create DomU, if bootloader is specified,
'kernel/ramdisk' will be used by bootloader when
boots DomU. So it is needless to check the path
is existent or not.

Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>

diff -r d867eb643fe4 -r 05e57f4db35d tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py	Tue Jul 13 18:17:28 2010 +0100
+++ b/tools/python/xen/xm/create.py	Thu Jul 15 18:33:04 2010 +0800
@@ -708,7 +708,12 @@
         return None
     config_image = [ vals.builder ]
     if vals.kernel:
-        if os.path.dirname(vals.kernel) != "" and os.path.exists(vals.kernel):
+        if vals.bootloader:
+            # If bootloader is specified, vals.kernel will be used
+            # by bootloader when boots DomU. So it is needless to
+            # check the path is existent or not.
+            config_image.append([ 'kernel', vals.kernel ])
+        elif os.path.dirname(vals.kernel) != "" and os.path.exists(vals.kernel):
             config_image.append([ 'kernel', vals.kernel ])
         elif vals.kernel == 'hvmloader':
             # Keep hvmloader w/o a path and let xend find it.
@@ -721,7 +726,10 @@
         else:
             raise ValueError('Cannot find kernel "%s"' % vals.kernel)
     if vals.ramdisk:
-        if os.path.dirname(vals.ramdisk) != "" and os.path.exists(vals.ramdisk):
+        if vals.bootloader:
+            # Same with 'kernel' above
+            config_image.append([ 'ramdisk', vals.ramdisk ])
+        elif os.path.dirname(vals.ramdisk) != "" and os.path.exists(vals.ramdisk):
             config_image.append([ 'ramdisk', vals.ramdisk ])
         elif os.path.exists(os.path.abspath(vals.ramdisk)):
             # Keep old behaviour, if path is valid.

  reply	other threads:[~2010-07-15  2:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-14  6:15 [PATCH] Don't attach needless options when launch pygrub Yu Zhiguo
2010-07-14  6:47 ` Ian Campbell
2010-07-14  7:29   ` Yu Zhiguo
2010-07-14  8:10     ` Ian Campbell
2010-07-14  9:36       ` Yu Zhiguo
2010-07-14  9:46         ` Ian Campbell
2010-07-14 10:07           ` Yu Zhiguo
2010-07-14 10:21             ` Yu Zhiguo
2010-07-14 10:22             ` Ian Campbell
2010-07-14 11:01               ` Yu Zhiguo
2010-07-14 11:10                 ` Ian Campbell
2010-07-14 11:21                   ` Yu Zhiguo
2010-07-14 12:33                     ` Ian Campbell
2010-07-15  2:37                       ` Yu Zhiguo [this message]
2010-07-15  7:42                         ` [PATCH] xm: needless to check 'kernel/ramdisk' is existent or not Ian Campbell
2010-07-15  7:56                         ` Ian Campbell
2010-07-15  3:44       ` [PATCH] Don't attach needless options when launch pygrub Zhigang Wang
2010-07-15  5:03         ` Yu Zhiguo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C3E747F.9050208@cn.fujitsu.com \
    --to=yuzg@cn.fujitsu.com \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.