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-devel

[Xen-devel] Re: [PATCH] xm: needless to check 'kernel/ramdisk' is existe

On Thu, 2010-07-15 at 03:37 +0100, Yu Zhiguo wrote:
> 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@xxxxxxxxxxxxxx>

Thanks Yu.

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> 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.
> 
> 



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