From patchwork Fri Jan 13 22:05:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Harper X-Patchwork-Id: 136024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 813E4B6EFF for ; Sat, 14 Jan 2012 09:07:17 +1100 (EST) Received: from localhost ([::1]:53169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlpHG-0005Im-V5 for incoming@patchwork.ozlabs.org; Fri, 13 Jan 2012 17:07:14 -0500 Received: from eggs.gnu.org ([140.186.70.92]:36321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlpHA-0005IS-5p for qemu-devel@nongnu.org; Fri, 13 Jan 2012 17:07:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlpH6-00081a-He for qemu-devel@nongnu.org; Fri, 13 Jan 2012 17:07:08 -0500 Received: from e35.co.us.ibm.com ([32.97.110.153]:39011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlpH6-00081D-9m for qemu-devel@nongnu.org; Fri, 13 Jan 2012 17:07:04 -0500 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Jan 2012 15:06:58 -0700 Received: from d03relay05.boulder.ibm.com (9.17.195.107) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 13 Jan 2012 15:06:22 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q0DM6GDj086724 for ; Fri, 13 Jan 2012 15:06:17 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q0DM6G1o006303 for ; Fri, 13 Jan 2012 15:06:16 -0700 Received: from localhost ([9.12.226.92]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q0DM6FEv006218; Fri, 13 Jan 2012 15:06:15 -0700 From: Ryan Harper To: qemu-devel@nongnu.org Date: Fri, 13 Jan 2012 16:05:21 -0600 Message-Id: <1326492321-13540-5-git-send-email-ryanh@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1326492321-13540-1-git-send-email-ryanh@us.ibm.com> References: <1326492321-13540-1-git-send-email-ryanh@us.ibm.com> x-cbid: 12011322-6148-0000-0000-0000029CB947 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 32.97.110.153 Cc: Ryan Harper Subject: [Qemu-devel] [PATCH 4/4] Apply consistent indentation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Inner blocks of if/for/while are all indented. Signed-off-by: Ryan Harper --- qemu-test | 56 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 28 insertions(+), 28 deletions(-) diff --git a/qemu-test b/qemu-test index 445ca6d..9750a3f 100755 --- a/qemu-test +++ b/qemu-test @@ -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