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: [Xen-staging] [xen-unstable] xendomains: Better sanity c

To: Gawain Lynch <gawain.lynch@xxxxxxxxx>
Subject: [Xen-devel] Re: [Xen-staging] [xen-unstable] xendomains: Better sanity checking of potetntial save records.
From: Aron Griffis <aron@xxxxxx>
Date: Tue, 3 Jul 2007 09:05:09 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 03 Jul 2007 06:03:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200707030914.l639EL4L021527@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Gawain Lynch <gawain.lynch@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
References: <200707030914.l639EL4L021527@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
Just a couple of comments below.

Xen staging patchbot-unstable wrote:  [Tue Jul 03 2007, 05:14:20AM EDT]
> # HG changeset patch
> # User kfraser@xxxxxxxxxxxxxxxxxxxxx
> # Date 1183453942 -3600
> # Node ID 356bd2f3b9d805df5c59d1758832369183d2ddda
> # Parent  a836f4bc86fdfa84a169b0135486a8a6b0c1d516
> xendomains: Better sanity checking of potetntial save records.
> Signed-off-by: Gawain Lynch <gawain.lynch@xxxxxxxxx>
> ---
>  tools/examples/init.d/xendomains |   29 ++++++++++++++++-------------
>  1 files changed, 16 insertions(+), 13 deletions(-)
> 
> diff -r a836f4bc86fd -r 356bd2f3b9d8 tools/examples/init.d/xendomains
> --- a/tools/examples/init.d/xendomains        Tue Jul 03 10:08:34 2007 +0100
> +++ b/tools/examples/init.d/xendomains        Tue Jul 03 10:12:22 2007 +0100
> @@ -221,22 +221,26 @@ start()
>      if [ "$XENDOMAINS_RESTORE" = "true" ] &&
>         contains_something "$XENDOMAINS_SAVE"
>      then
> -     XENDOMAINS_SAVED=`/bin/ls $XENDOMAINS_SAVE/* | grep -v 'lost+found'`
>       mkdir -p $(dirname "$LOCKFILE")
>       touch $LOCKFILE
>       echo -n "Restoring Xen domains:"
>       saved_domains=`ls $XENDOMAINS_SAVE`
> -     for dom in $XENDOMAINS_SAVED; do
> -         echo -n " ${dom##*/}"
> -         xm restore $dom
> -         if [ $? -ne 0 ]; then
> -             rc_failed $?
> -             echo -n '!'
> -         else
> -             # mv $dom ${dom%/*}/.${dom##*/}
> -             rm $dom
> -         fi
> -     done
> +        for dom in $XENDOMAINS_SAVE/*; do
> +            if [ -f $dom ] ; then
> +                HEADER=`head -c 16 $dom | head -n 1 2> /dev/null`

You're never going to get error output from the second head operating
on stdin.  This should be:
                   HEADER=`head -c 16 $dom 2>/dev/null | head -n 1`
                    
> +                if [ $HEADER = "LinuxGuestRecord" ]; then

$HEADER should be quoted.  There's no guarantee it won't be something
bogus that contains spaces.
                   if [ "$HEADER" = LinuxGuestRecord ]; then

> +                    echo -n " ${dom##*/}"
> +                    xm restore $dom
> +                    if [ $? -ne 0 ]; then
> +                        rc_failed $?
> +                        echo -n '!'
> +                    else
> +                        # mv $dom ${dom%/*}/.${dom##*/}
> +                        rm $dom
> +                    fi
> +                fi
> +            fi
> +        done
>       echo .
>      fi
>  
> @@ -260,7 +264,6 @@ start()
>           if [ $? -eq 0 ] || is_running $dom; then
>               echo -n "(skip)"
>           else
> -             echo "(booting)"
>               xm create --quiet --defconfig $dom
>               if [ $? -ne 0 ]; then
>                   rc_failed $?
> 
> _______________________________________________
> Xen-staging mailing list
> Xen-staging@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-staging
> 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Re: [Xen-staging] [xen-unstable] xendomains: Better sanity checking of potetntial save records., Aron Griffis <=