@@ -2,7 +2,7 @@
cleanup() {
if test -n "$tmpdir"; then
- rm -rf $tmpdir;
+ rm -rf $tmpdir;
fi
}
@@ -29,9 +29,9 @@ if ! which qmp >/dev/null 2>/dev/null; then
qmp="${QEMU_SRC}/QMP/qmp"
if ! test -x "${qmp}"; then
- echo "Please set QEMU_SRC to set to a recent qemu.git tree"
- cleanup
- exit 1
+ echo "Please set QEMU_SRC to set to a recent qemu.git tree"
+ cleanup
+ exit 1
fi
else
qmp=`which qmp | head -1`
@@ -63,9 +63,9 @@ checkpid() {
get_file_size() {
if test -r "${1}" ; then
- ls -al $1 | cut -f5 -d' '
+ ls -al $1 | cut -f5 -d' '
else
- echo 0
+ echo 0
fi
}
@@ -104,11 +104,11 @@ choose() {
target=$(($RANDOM % $#))
count=0
for i in "$@"; do
- if test $count = $target; then
- echo $i
- return 0
- fi
- count=$(($count + 1))
+ if test $count = $target; then
+ echo $i
+ return 0
+ fi
+ count=$(($count + 1))
done
# not supposed to happen...
@@ -117,7 +117,7 @@ choose() {
choose_bool() {
if test `choose yes no` = "yes"; then
- return 0
+ return 0
fi
return 1
}
@@ -135,34 +135,34 @@ start_qemu() {
qemu_is_okay() {
# it's stopped, that's not necessarly bad
if ! checkpid $pid; then
- return 1
+ return 1
fi
log_size=`get_file_size $tmplog`
if test $last_log_size = $log_size; then
- freeze_count=$(($freeze_count + 1))
+ freeze_count=$(($freeze_count + 1))
else
- freeze_count=0
- last_log_size=$log_size
+ freeze_count=0
+ last_log_size=$log_size
fi
if test $freeze_count -gt $FREEZE_THRESHOLD && checkpid $pid; then
- qemu_pid=`cat $tmppid`
- kill -9 $qemu_pid
- echo "Guest ($qemu_pid) has not had output in $FREEZE_THRESHOLD seconds!"
- return 2
+ qemu_pid=`cat $tmppid`
+ kill -9 $qemu_pid
+ echo "Guest ($qemu_pid) has not had output in $FREEZE_THRESHOLD seconds!"
+ return 2
fi
if ! qmp query-status >/dev/null 2>/dev/null && checkpid $pid; then
- qemu_pid=`cat $tmppid`
-
- kill -9 $qemu_pid
- echo "QEMU is hung!"
- return 3
+ qemu_pid=`cat $tmppid`
+
+ kill -9 $qemu_pid
+ echo "QEMU is hung!"
+ return 3
fi
# it's stopped, that's not necessarly bad
if ! checkpid $pid; then
- return 1
+ return 1
fi
}
@@ -170,7 +170,7 @@ get_qemu_status() {
wait $pid
rc=`cat $tmprc`
if test $(($rc & 1)) = 1; then
- rc=$(($rc / 2))
+ rc=$(($rc / 2))
fi
return $rc
}
@@ -179,7 +179,7 @@ qemu() {
start_qemu "$@"
while qemu_is_okay; do
- sleep 1
+ sleep 1
done
get_qemu_status
Inner blocks of if/for/while are all indented. Signed-off-by: Ryan Harper <ryanh@us.ibm.com> --- qemu-test | 56 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 28 insertions(+), 28 deletions(-)