All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>
Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v2 2/2] qemu-ga: sample fsfreeze hooks
Date: Mon, 12 Nov 2012 15:16:00 -0700	[thread overview]
Message-ID: <50A17520.2090608@redhat.com> (raw)
In-Reply-To: <20121112093258.20398.52001.stgit@melchior2.sdl.hitachi.co.jp>

[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]

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 <tomoki.sekiyama.qu@hitachi.com>
> ---

> +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   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 617 bytes --]

  reply	other threads:[~2012-11-12 22:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12  9:32 [Qemu-devel] [PATCH v2 0/2] qemu-ga: add hook to quiesce the guest on fsfreeze-freeze/thaw Tomoki Sekiyama
2012-11-12  9:32 ` [Qemu-devel] [PATCH v2 1/2] qemu-ga: execute " Tomoki Sekiyama
2012-11-12  9:32 ` [Qemu-devel] [PATCH v2 2/2] qemu-ga: sample fsfreeze hooks Tomoki Sekiyama
2012-11-12 22:16   ` Eric Blake [this message]
2012-11-13  4:49     ` Tomoki Sekiyama

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=50A17520.2090608@redhat.com \
    --to=eblake@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tomoki.sekiyama.qu@hitachi.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.