qemu-ga: sample fsfreeze-script
PATCH 2/2 qemu-ga: sample fsfreeze-script
Adds sample scripts for --fsfreeze-script option of qemu-ga.
-fsfreeze.sh: iterates and execute scripts in fsfreeze.d/ -fsfreeze.d/mysql-flush.sh: quiesce MySQL before snapshot
Signed-off-by Tomoki Sekiyama <[email protected]>
--- .gitignore | 1 + .../fsfreeze.d/mysql-flush.sh | 41 ++++++++++++++++++++++ .../fsfreeze-script-sample/fsfreeze.sh | 17 +++++++++ 3 files changed, 59 insertions(+) create mode 100755 docs/qemu-guest-agent/fsfreeze-script-sample/fsfreeze.d/mysql-flush.sh create mode 100755 docs/qemu-guest-agent/fsfreeze-script-sample/fsfreeze.sh
.gitignore +1 -0
@@ -68,6 +68,7 @@ fsdev/virtfs-proxy-helper.pod *.tp *.vr *.d +!fsfreeze.d *.o *.lo *.la
docs/qemu-guest-agent/fsfreeze-script-sample/fsfreeze.d/mysql-flush.sh new file +41 -0
41 lines not on this page · raw message
docs/qemu-guest-agent/fsfreeze-script-sample/fsfreeze.sh new file +17 -0
@@ -0,0 +1,17 @@ +#!/bin/bash + +# This script is executed when a guest agent receives fsfreeze-freeze and +# fsfreeze-thaw command when it is specified in --fsfreeze-script/-F option +# of qemu-ga or placed in default path (/etc/qemu/fsfreeze-script.sh). +# When the agent receives fsfreeze-freeze command, the script is issued with +# "freeze" argument before the filesystem is freezed.. And for fsfreeze-thaw, +# it is issued with "thaw" argument after filesystem is thawed. +# +# This script iterates executables in directory "fsfreeze.d" with the +# specified argument. + +cd `dirname $0` +cd fsfreeze.d +for x in *; do + [ -x ./$x ] && ./$x $1 +done
Signature · 1 line
1.7.11.7