Skip to content

Commit e6c172a

Browse files
XanClicmdroth
authored andcommitted
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: [email protected] Signed-off-by: Max Reitz <[email protected]> Reviewed-by: Kevin Wolf <[email protected]> Signed-off-by: Kevin Wolf <[email protected]> (cherry picked from commit f798068) Signed-off-by: Michael Roth <[email protected]>
1 parent 07ede68 commit e6c172a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/qemu-iotests/common.rc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ _cleanup_test_img()
189189
case "$IMGPROTO" in
190190

191191
nbd)
192-
kill $QEMU_NBD_PID
192+
if [ -n "$QEMU_NBD_PID" ]; then
193+
kill $QEMU_NBD_PID
194+
fi
193195
rm -f "$TEST_IMG_FILE"
194196
;;
195197
file)

0 commit comments

Comments
 (0)