From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu0NX-0000ZV-MN for qemu-devel@nongnu.org; Thu, 27 Nov 2014 09:49:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xu0NS-0003Yr-EQ for qemu-devel@nongnu.org; Thu, 27 Nov 2014 09:49:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu0NS-0003Yd-8F for qemu-devel@nongnu.org; Thu, 27 Nov 2014 09:49:02 -0500 From: Max Reitz Date: Thu, 27 Nov 2014 15:48:35 +0100 Message-Id: <1417099720-16428-9-git-send-email-mreitz@redhat.com> In-Reply-To: <1417099720-16428-1-git-send-email-mreitz@redhat.com> References: <1417099720-16428-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v2 08/13] iotests: Only kill NBD server if it runs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Lieven , Markus Armbruster , Max Reitz , Stefan Hajnoczi There may be NBD tests which do not create a sample image and simply test whether wrong usage of the protocol is rejected as expected. In this case, there will be no NBD server and trying to kill it during clean-up will fail. Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz --- tests/qemu-iotests/common.rc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 9c49deb..f2554ec 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -175,7 +175,9 @@ _cleanup_test_img() case "$IMGPROTO" in nbd) - kill $QEMU_NBD_PID + if [ -n "$QEMU_NBD_PID" ]; then + kill $QEMU_NBD_PID + fi rm -f "$TEST_IMG_FILE" ;; file) -- 1.9.3