Skip to content

Commit f874e7f

Browse files
Vladimir Sementsov-Ogievskiyebblake
authored andcommitted
iotests.py: qemu_io(): reuse qemu_tool_pipe_and_status()
Just drop code duplication. Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]> Message-Id: <[email protected]> Reviewed-by: Eric Blake <[email protected]> Signed-off-by: Eric Blake <[email protected]>
1 parent 5bd04f6 commit f874e7f

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

tests/qemu-iotests/iotests.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,7 @@ def img_info_log(filename, filter_path=None, imgopts=False, extra_args=()):
188188
def qemu_io(*args):
189189
'''Run qemu-io and return the stdout data'''
190190
args = qemu_io_args + list(args)
191-
subp = subprocess.Popen(args, stdout=subprocess.PIPE,
192-
stderr=subprocess.STDOUT,
193-
universal_newlines=True)
194-
output = subp.communicate()[0]
195-
if subp.returncode < 0:
196-
sys.stderr.write('qemu-io received signal %i: %s\n'
197-
% (-subp.returncode, ' '.join(args)))
198-
return output
191+
return qemu_tool_pipe_and_status('qemu-io', args)[0]
199192

200193
def qemu_io_log(*args):
201194
result = qemu_io(*args)

0 commit comments

Comments
 (0)