提交 f798068c 编写于 作者: M Max Reitz 提交者: Kevin Wolf

iotests: Only kill NBD server if it runs

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: NMax Reitz <mreitz@redhat.com>
Reviewed-by: NKevin Wolf <kwolf@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 b2439d26
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册