From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQNUB-0007rY-MZ for qemu-devel@nongnu.org; Tue, 24 Feb 2015 16:57:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQNU7-00015P-LW for qemu-devel@nongnu.org; Tue, 24 Feb 2015 16:57:47 -0500 Received: from e31.co.us.ibm.com ([32.97.110.149]:42029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQNU7-00015E-Ec for qemu-devel@nongnu.org; Tue, 24 Feb 2015 16:57:43 -0500 Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Feb 2015 14:57:42 -0700 From: Michael Roth Date: Tue, 24 Feb 2015 15:47:43 -0600 Message-Id: <1424814498-6993-9-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1424814498-6993-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1424814498-6993-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 08/43] 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 , qemu-stable@nongnu.org, Max Reitz From: Max Reitz 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 Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf (cherry picked from commit f798068c565918ead63218d083ff814b7635be72) Signed-off-by: Michael Roth --- 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.1