aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/147
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-05-08 23:18:17 +0200
committerEric Blake <eblake@redhat.com>2019-06-13 08:50:47 -0500
commit6177b58431cd19fddfd025225403876b8deeeec7 (patch)
treeb73f7dc76638cbfc057282c3bfbcf14563c0edd7 /tests/qemu-iotests/147
parent637bc5a5d8b7612bbbccd998d4183d2affb189e6 (diff)
iotests.py: Add qemu_nbd_early_pipe()
qemu_nbd_pipe() currently unconditionally reads qemu-nbd's output. That is not ideal because qemu-nbd may keep stderr open after the parent process has exited. Currently, the only user of qemu_nbd_pipe() is 147, which discards the whole output if the parent process returned success and only evaluates it on error. Therefore, we can replace qemu_nbd_pipe() by qemu_nbd_early_pipe() that does the same: Discard the output on success, and return it on error. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190508211820.17851-3-mreitz@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/147')
-rwxr-xr-xtests/qemu-iotests/1474
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147
index 82513279b0..2d84fddb01 100755
--- a/tests/qemu-iotests/147
+++ b/tests/qemu-iotests/147
@@ -24,7 +24,7 @@ import socket
import stat
import time
import iotests
-from iotests import cachemode, imgfmt, qemu_img, qemu_nbd, qemu_nbd_pipe
+from iotests import cachemode, imgfmt, qemu_img, qemu_nbd, qemu_nbd_early_pipe
NBD_PORT_START = 32768
NBD_PORT_END = NBD_PORT_START + 1024
@@ -93,7 +93,7 @@ class QemuNBD(NBDBlockdevAddBase):
pass
def _try_server_up(self, *args):
- status, msg = qemu_nbd_pipe('-f', imgfmt, test_img, *args)
+ status, msg = qemu_nbd_early_pipe('-f', imgfmt, test_img, *args)
if status == 0:
return True
if 'Address already in use' in msg: