diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 9c49deb3dd2138c0b3b27a1b073a99e58d90d3bd..f2554ec0af1161b4c73ca4bd3f7321199c4605d7 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)