qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 2/2] qemu-ga: sample fsfreeze hooks


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 2/2] qemu-ga: sample fsfreeze hooks
Date: Mon, 12 Nov 2012 15:16:00 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121029 Thunderbird/16.0.2

On 11/12/2012 02:32 AM, Tomoki Sekiyama wrote:
> Adds sample hook scripts for --fsfreeze-hook option of qemu-ga.
>   - fsfreeze-hook : execute scripts in fsfreeze-hook.d/
>   - fsfreeze-hook.d.sample/mysql-flush.sh : quiesce MySQL before snapshot
> 
> Signed-off-by: Tomoki Sekiyama <address@hidden>
> ---

> +LOGFILE=/var/log/qga-fsreeze-hook.log

s/fsreeze/fsfreeze/

> +# Iterate executables in directory "fsfreeze-hook.d" with the specified args
> +[ ! -d "$FSFREEZE_D" ] && exit 1
> +for file in "$FSFREEZE_D"/* ; do
> +    is_ignored_file "$file" && continue
> +    [ -x "$file" ] || continue
> +    echo $(date) ": execute $file $@" >>$LOGFILE

Put $(date) inside the ""; otherwise, single-digit days will be one
character shorter due to IFS field splitting eating the double-space;
and I don't like unaligned dates in logs.

> +    "$file" "$@" >>$LOGFILE 2>&1
> +    STATUS=$?
> +    echo $(date) ": $file finished with status=$STATUS" >>$LOGFILE

and again.

> +        INNODB_STATUS=$(mktemp /tmp/mysql-flush.XXXXXX)
> +        [ $? -ne 0 ] && exit 2
> +        trap "rm -f $INNODB_STATUS" SIGINT
> +        while :; do
> +            echo 'SHOW ENGINE INNODB STATUS \G' | $MYSQL > $INNODB_STATUS

'echo' cannot portably be used with \.  Use 'printf' instead.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]