[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 09/12] iotests.py: Add qemu_nbd function
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v4 09/12] iotests.py: Add qemu_nbd function |
Date: |
Wed, 28 Sep 2016 22:55:59 +0200 |
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/iotests.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 3329bc1..5a2678f 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -39,6 +39,10 @@ qemu_io_args = [os.environ.get('QEMU_IO_PROG', 'qemu-io')]
if os.environ.get('QEMU_IO_OPTIONS'):
qemu_io_args += os.environ['QEMU_IO_OPTIONS'].strip().split(' ')
+qemu_nbd_args = [os.environ.get('QEMU_NBD_PROG', 'qemu-nbd')]
+if os.environ.get('QEMU_NBD_OPTIONS'):
+ qemu_nbd_args += os.environ['QEMU_NBD_OPTIONS'].strip().split(' ')
+
qemu_prog = os.environ.get('QEMU_PROG', 'qemu')
qemu_opts = os.environ.get('QEMU_OPTIONS', '').strip().split(' ')
@@ -87,6 +91,10 @@ def qemu_io(*args):
sys.stderr.write('qemu-io received signal %i: %s\n' % (-exitcode, '
'.join(args)))
return subp.communicate()[0]
+def qemu_nbd(*args):
+ '''Run qemu-nbd in daemon mode and return the parent's exit code'''
+ return subprocess.call(qemu_nbd_args + ['--fork'] + list(args))
+
def compare_images(img1, img2, fmt1=imgfmt, fmt2=imgfmt):
'''Return True if two image files are identical'''
return qemu_img('compare', '-f', fmt1,
--
2.10.0
- [Qemu-devel] [PATCH v4 00/12] qapi: Allow blockdev-add for NBD, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 01/12] block/nbd: Drop trailing "." in error messages, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 02/12] block/nbd: Reject port parameter without host, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 03/12] block/nbd: Default port in nbd_refresh_filename(), Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 04/12] block/nbd: Use qdict_put(), Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 05/12] block/nbd: Add nbd_has_filename_options_conflict(), Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 06/12] block/nbd: Accept SocketAddress, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 07/12] block/nbd: Use SocketAddress options, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 08/12] qapi: Allow blockdev-add for NBD, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 09/12] iotests.py: Add qemu_nbd function,
Max Reitz <=
- [Qemu-devel] [PATCH v4 10/12] iotests.py: Allow concurrent qemu instances, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 11/12] socket_scm_helper: Accept fd directly, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 12/12] iotests: Add test for NBD's blockdev-add interface, Max Reitz, 2016/09/28