summaryrefslogtreecommitdiffstats
path: root/qemu/scripts/qemu-guest-agent/fsfreeze-hook.d
diff options
context:
space:
mode:
authorRajithaY <rajithax.yerrumsetty@intel.com>2017-04-25 03:31:15 -0700
committerRajitha Yerrumchetty <rajithax.yerrumsetty@intel.com>2017-05-22 06:48:08 +0000
commitbb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch)
treeca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/scripts/qemu-guest-agent/fsfreeze-hook.d
parenta14b48d18a9ed03ec191cf16b162206998a895ce (diff)
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to kvmfornfv repo and make use of the updated latest qemu for the execution of all testcase Change-Id: I1280af507a857675c7f81d30c95255635667bdd7 Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/scripts/qemu-guest-agent/fsfreeze-hook.d')
-rwxr-xr-xqemu/scripts/qemu-guest-agent/fsfreeze-hook.d/mysql-flush.sh.sample56
1 files changed, 0 insertions, 56 deletions
diff --git a/qemu/scripts/qemu-guest-agent/fsfreeze-hook.d/mysql-flush.sh.sample b/qemu/scripts/qemu-guest-agent/fsfreeze-hook.d/mysql-flush.sh.sample
deleted file mode 100755
index 2b4fa3aeb..000000000
--- a/qemu/scripts/qemu-guest-agent/fsfreeze-hook.d/mysql-flush.sh.sample
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-
-# Flush MySQL tables to the disk before the filesystem is frozen.
-# At the same time, this keeps a read lock in order to avoid write accesses
-# from the other clients until the filesystem is thawed.
-
-MYSQL="/usr/bin/mysql"
-MYSQL_OPTS="-uroot" #"-prootpassword"
-FIFO=/var/run/mysql-flush.fifo
-
-# Check mysql is installed and the server running
-[ -x "$MYSQL" ] && "$MYSQL" $MYSQL_OPTS < /dev/null || exit 0
-
-flush_and_wait() {
- printf "FLUSH TABLES WITH READ LOCK \\G\n"
- trap 'printf "$(date): $0 is killed\n">&2' HUP INT QUIT ALRM TERM
- read < $FIFO
- printf "UNLOCK TABLES \\G\n"
- rm -f $FIFO
-}
-
-case "$1" in
- freeze)
- mkfifo $FIFO || exit 1
- flush_and_wait | "$MYSQL" $MYSQL_OPTS &
- # wait until every block is flushed
- while [ "$(echo 'SHOW STATUS LIKE "Key_blocks_not_flushed"' |\
- "$MYSQL" $MYSQL_OPTS | tail -1 | cut -f 2)" -gt 0 ]; do
- sleep 1
- done
- # for InnoDB, wait until every log is flushed
- INNODB_STATUS=$(mktemp /tmp/mysql-flush.XXXXXX)
- [ $? -ne 0 ] && exit 2
- trap "rm -f $INNODB_STATUS; exit 1" HUP INT QUIT ALRM TERM
- while :; do
- printf "SHOW ENGINE INNODB STATUS \\G" |\
- "$MYSQL" $MYSQL_OPTS > $INNODB_STATUS
- LOG_CURRENT=$(grep 'Log sequence number' $INNODB_STATUS |\
- tr -s ' ' | cut -d' ' -f4)
- LOG_FLUSHED=$(grep 'Log flushed up to' $INNODB_STATUS |\
- tr -s ' ' | cut -d' ' -f5)
- [ "$LOG_CURRENT" = "$LOG_FLUSHED" ] && break
- sleep 1
- done
- rm -f $INNODB_STATUS
- ;;
-
- thaw)
- [ ! -p $FIFO ] && exit 1
- echo > $FIFO
- ;;
-
- *)
- exit 1
- ;;
-esac