diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-07-16 14:02:30 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-07-16 14:02:30 +0100 |
commit | 72c32a22a13ad9694429652855710ffe25236354 (patch) | |
tree | e5eb13a36997eb37741341281fa832ca14ce60dd | |
parent | 71477a460fdc3dcd6fe10e60195978d052b5eec7 (diff) | |
download | xen-72c32a22a13ad9694429652855710ffe25236354.tar.gz xen-72c32a22a13ad9694429652855710ffe25236354.tar.bz2 xen-72c32a22a13ad9694429652855710ffe25236354.zip |
xm: Do not check path of kernel if bootloader is specified
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>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen-unstable changeset: 21807:6fdb00dc93a5
xen-unstable date: Thu Jul 15 16:32:50 2010 +0100
-rw-r--r-- | tools/python/xen/xm/create.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index c8e0ab8fa6..74f3ec0238 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -704,7 +704,12 @@ def configure_image(vals): 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. @@ -717,7 +722,10 @@ def configure_image(vals): 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. |