All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, mreitz@redhat.com, kwolf@redhat.com,
	eblake@redhat.com, vsementsov@virtuozzo.com, den@openvz.org
Subject: [PATCH v2 4/8] iotests.py: qemu_io(): reuse qemu_tool_pipe_and_status()
Date: Mon, 30 Nov 2020 16:40:20 +0300	[thread overview]
Message-ID: <20201130134024.19212-5-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20201130134024.19212-1-vsementsov@virtuozzo.com>

Just drop code duplication.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 tests/qemu-iotests/iotests.py | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 5ebe25e063..6c9bcf9042 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -188,14 +188,7 @@ def img_info_log(filename, filter_path=None, imgopts=False, extra_args=()):
 def qemu_io(*args):
     '''Run qemu-io and return the stdout data'''
     args = qemu_io_args + list(args)
-    subp = subprocess.Popen(args, stdout=subprocess.PIPE,
-                            stderr=subprocess.STDOUT,
-                            universal_newlines=True)
-    output = subp.communicate()[0]
-    if subp.returncode < 0:
-        sys.stderr.write('qemu-io received signal %i: %s\n'
-                         % (-subp.returncode, ' '.join(args)))
-    return output
+    return qemu_tool_pipe_and_status('qemu-io', args)[0]
 
 def qemu_io_log(*args):
     result = qemu_io(*args)
-- 
2.21.3



  parent reply	other threads:[~2020-11-30 13:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 13:40 [PATCH v2 for-6.0 0/8] nbd reconnect on open Vladimir Sementsov-Ogievskiy
2020-11-30 13:40 ` [PATCH v2 1/8] block/nbd: move initial connect to coroutine Vladimir Sementsov-Ogievskiy
2021-01-20 22:24   ` Eric Blake
2020-11-30 13:40 ` [PATCH v2 2/8] nbd: allow reconnect on open, with corresponding new options Vladimir Sementsov-Ogievskiy
2021-01-21  1:44   ` Eric Blake
2021-01-22 10:56     ` Vladimir Sementsov-Ogievskiy
2020-11-30 13:40 ` [PATCH v2 3/8] iotests.py: fix qemu_tool_pipe_and_status() Vladimir Sementsov-Ogievskiy
2021-01-21  1:58   ` Eric Blake
2020-11-30 13:40 ` Vladimir Sementsov-Ogievskiy [this message]
2021-01-21  2:13   ` [PATCH v2 4/8] iotests.py: qemu_io(): reuse qemu_tool_pipe_and_status() Eric Blake
2020-11-30 13:40 ` [PATCH v2 5/8] iotests.py: add qemu_tool_popen() Vladimir Sementsov-Ogievskiy
2020-11-30 13:40 ` [PATCH v2 6/8] iotests.py: add and use qemu_io_wrap_args() Vladimir Sementsov-Ogievskiy
2020-11-30 13:40 ` [PATCH v2 7/8] iotests.py: add qemu_io_popen() Vladimir Sementsov-Ogievskiy
2020-11-30 13:40 ` [PATCH v2 8/8] iotests: add 306 to test reconnect on nbd open Vladimir Sementsov-Ogievskiy
2020-12-18 10:57 ` [PATCH v2 for-6.0 0/8] nbd reconnect on open Vladimir Sementsov-Ogievskiy
2021-01-09 10:11   ` Vladimir Sementsov-Ogievskiy
2021-01-21  2:17 ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201130134024.19212-5-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.