Skip to contentSkip to conversation

iotests: Launch qemu-nbd with -e 42

PATCH Applied Max Reitz 3 participants 4 messages Apr 26, 2017

lore
Share & tools
lore

Max Reitz

author
#0 lore raw

PATCH 1/1 iotests: Launch qemu-nbd with -e 42

There is no reason for the qemu-nbd server used for tests not to accept an arbitrary number of clients. In fact, test 181 will require it to accept two clients at the same time (and thus it fails before this patch).

This patch updates common.rc to launch qemu-nbd with -e 42 which should be enough for all of our current and future tests.

---
 tests/qemu-iotests/common.rc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/qemu-iotests/common.rc +3 -1
index 7d4781d4ad..31b888d4e9 100644
@@ -168,7 +168,9 @@ _make_test_img()
 
     # Start an NBD server on the image file, which is what we'll be talking to
     if [ $IMGPROTO = "nbd" ]; then
-        eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT  $TEST_IMG_FILE >/dev/null &"
+        # Pass a sufficiently high number to -e that should be enough for all
+        # tests
+        eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT -e 42  $TEST_IMG_FILE >/dev/null &"
         sleep 1 # FIXME: qemu-nbd needs to be listening before we continue
     fi
 }
Signature · 1 line
2.12.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Max Reitz

There is no reason for the qemu-nbd server used for tests not to accept an arbitrary number of clients. In fact, test 181 will require it to accept two clients at the same time (and thus it fails before this patch).

This patch updates common.rc to launch qemu-nbd with -e 42 which should be enough for all of our current and future tests.

Perfect place for you to inject some jibe about "life, the universe, and everything" ;)

Quoted 13 lines
---
 tests/qemu-iotests/common.rc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/qemu-iotests/common.rc +0 -0
index 7d4781d4ad..31b888d4e9 100644

tests/qemu-iotests/common.rc _make_test_img() · line 173

Quoted 7 lines
tests/qemu-iotests/common.rc +3 -1
@@ -168,7 +168,9 @@ _make_test_img()
 
     # Start an NBD server on the image file, which is what we'll be talking to
     if [ $IMGPROTO = "nbd" ]; then
-        eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT  $TEST_IMG_FILE >/dev/null &"
+        # Pass a sufficiently high number to -e that should be enough for all
+        # tests
+        eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT -e 42  $TEST_IMG_FILE >/dev/null &"

Worth dropping the double-space before $TEST_IMG_FILE while touching this?

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
author
#2 lore raw
Quoted 11 lines · Eric Blake
Quoted 7 lines · Max Reitz

There is no reason for the qemu-nbd server used for tests not to accept an arbitrary number of clients. In fact, test 181 will require it to accept two clients at the same time (and thus it fails before this patch).

This patch updates common.rc to launch qemu-nbd with -e 42 which should be enough for all of our current and future tests.

Perfect place for you to inject some jibe about "life, the universe, and everything" ;)

Everybody knows anyway. ;-)

Quoted 14 lines
Quoted 14 lines
---
 tests/qemu-iotests/common.rc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/qemu-iotests/common.rc +0 -0
index 7d4781d4ad..31b888d4e9 100644
@@ -168,7 +168,9 @@ _make_test_img()
 
Quoted 8 lines

tests/qemu-iotests/common.rc _make_test_img() · line 173

Quoted 6 lines
tests/qemu-iotests/common.rc +3 -1
     # Start an NBD server on the image file, which is what we'll be talking to
     if [ $IMGPROTO = "nbd" ]; then
-        eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT  $TEST_IMG_FILE >/dev/null &"
+        # Pass a sufficiently high number to -e that should be enough for all
+        # tests
+        eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT -e 42  $TEST_IMG_FILE >/dev/null &"

Worth dropping the double-space before $TEST_IMG_FILE while touching this?

I wasn't sure myself. It somehow is a nice separation between the option arguments and the image file name so I thought that maybe it was intended and was afraid to remove it... Well, and it doesn't really hurt.

Why don't we have CODING_STYLE for shell scripts? :-)

Quoted 1 line

Thanks!

Max

Applied
#3 lore raw
In reply to Max Reitz

Am 26.04.2017 um 16:14 hat Max Reitz geschrieben:

Quoted 9 lines

There is no reason for the qemu-nbd server used for tests not to accept an arbitrary number of clients. In fact, test 181 will require it to accept two clients at the same time (and thus it fails before this patch).

This patch updates common.rc to launch qemu-nbd with -e 42 which should be enough for all of our current and future tests.

Thanks, applied to block-next.

Kevin