All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aron Griffis <aron@hp.com>
To: Gawain Lynch <gawain.lynch@gmail.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-staging] [xen-unstable] xendomains: Better sanity checking of potetntial save records.
Date: Tue, 3 Jul 2007 09:05:09 -0400	[thread overview]
Message-ID: <20070703130508.GD11010@fc.hp.com> (raw)
In-Reply-To: <200707030914.l639EL4L021527@latara.uk.xensource.com>

Just a couple of comments below.

Xen staging patchbot-unstable wrote:  [Tue Jul 03 2007, 05:14:20AM EDT]
> # HG changeset patch
> # User kfraser@localhost.localdomain
> # Date 1183453942 -3600
> # Node ID 356bd2f3b9d805df5c59d1758832369183d2ddda
> # Parent  a836f4bc86fdfa84a169b0135486a8a6b0c1d516
> xendomains: Better sanity checking of potetntial save records.
> Signed-off-by: Gawain Lynch <gawain.lynch@gmail.com>
> ---
>  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@lists.xensource.com
> http://lists.xensource.com/xen-staging
> 

           reply	other threads:[~2007-07-03 13:05 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200707030914.l639EL4L021527@latara.uk.xensource.com>]

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=20070703130508.GD11010@fc.hp.com \
    --to=aron@hp.com \
    --cc=gawain.lynch@gmail.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.