From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [kvm-unit-tests PATCH 6/6] run scripts: add timeout support Date: Tue, 26 Jan 2016 22:44:07 +0100 Message-ID: <20160126214407.GB1844@potion.brq.redhat.com> References: <1453833731-23215-1-git-send-email-drjones@redhat.com> <1453833731-23215-7-git-send-email-drjones@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, pbonzini@redhat.com To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42290 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751184AbcAZVoK (ORCPT ); Tue, 26 Jan 2016 16:44:10 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id D52F63B718 for ; Tue, 26 Jan 2016 21:44:10 +0000 (UTC) Content-Disposition: inline In-Reply-To: <1453833731-23215-7-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 2016-01-26 19:42+0100, Andrew Jones: > Signed-off-by: Andrew Jones > --- > diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash > @@ -60,3 +61,10 @@ exit_fixup () > > return $ret > } > + > +timeout_cmd () > +{ > + if [ "$TIMEOUT" ] && [ "$TIMEOUT" != "0" ]; then > + echo "timeout --foreground $TIMEOUT" We could add "-k $(($TIMEOUT + 5))" in case QEMU ignores SIGTERM ... or just directly SIGKILL? > + fi > +}