nbd patches for 2017-09-06

- Daniel P. Berrange: [0/2] Fix / skip recent iotests with LUKS driver
 - Eric Blake: [0/3] nbd: Use common read/write-all qio functions
 -----BEGIN PGP SIGNATURE-----
 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
 
 iQEcBAABCAAGBQJZsBGjAAoJEKeha0olJ0NqVRoH/iiNEB2SlZFFl5W++wf3Ekq/
 lvtZjK3rxpvRXvy6LiRsYVs27Etc8E9aSw2UK6aaqgA3qR8g3zdmwUZb9w3slkeI
 OXedt0fS5IpQ4UP0ORUBb/LgyOgW3uA0UjHBTEAKl0SyvFPx+TrTZXxqQUqlAc9A
 lFaA0g71xvfqWWhXmt0PQjRr9bBEpe+4L4NgOypa+Z3xbBAektx390S8N/b/P8fC
 FNwAqBPTY5XAgJGnEhL9EUOdUWnVgoyG1MR63puJzULYi+2+TlpR2w030qRif75b
 h7TqYUvwKLnoqMyhBb5LmyhcqwNdphz/1DsEudk18XGuvC94WYkopC3rT7TPWLs=
 =vGUc
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-09-06' into staging

nbd patches for 2017-09-06

- Daniel P. Berrange: [0/2] Fix / skip recent iotests with LUKS driver
- Eric Blake: [0/3] nbd: Use common read/write-all qio functions

# gpg: Signature made Wed 06 Sep 2017 16:17:55 BST
# gpg:                using RSA key 0xA7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>"
# gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
# gpg:                 aka "[jpeg image of size 6874]"
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2017-09-06:
  nbd: Use new qio_channel_*_all() functions
  io: Add new qio_channel_read{, v}_all_eof functions
  io: Yield rather than wait when already in coroutine
  iotests: blacklist 194 with the luks driver
  iotests: rewrite 192 to use _launch_qemu to fix LUKS support

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2017-09-07 17:53:59 +01:00
commit 75be9a52b1
10 changed files with 141 additions and 111 deletions

View file

@ -69,12 +69,12 @@ read failed: Input/output error
=== Check disconnect 4 reply ===
End of file
Unexpected end-of-file before all bytes were read
read failed: Input/output error
=== Check disconnect 8 reply ===
End of file
Unexpected end-of-file before all bytes were read
read failed: Input/output error
=== Check disconnect before data ===
@ -180,12 +180,12 @@ read failed: Input/output error
=== Check disconnect 4 reply ===
End of file
Unexpected end-of-file before all bytes were read
read failed: Input/output error
=== Check disconnect 8 reply ===
End of file
Unexpected end-of-file before all bytes were read
read failed: Input/output error
=== Check disconnect before data ===

View file

@ -37,6 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
. ./common.qemu
_supported_fmt generic
_supported_proto file
@ -49,13 +50,21 @@ fi
size=64M
_make_test_img $size
{
echo "nbd_server_start unix:$TEST_DIR/nbd"
echo "nbd_server_add -w drive0"
echo "q"
} | $QEMU -nodefaults -display none -monitor stdio \
-drive format=$IMGFMT,file=$TEST_IMG,if=ide,id=drive0 \
-incoming defer 2>&1 | _filter_testdir | _filter_qemu | _filter_hmp
if test "$IMGOPTSSYNTAX" = "true"
then
DRIVE_ARG=if=ide,id=drive0,$TEST_IMG
else
DRIVE_ARG=if=ide,id=drive0,format=$IMGFMT,file=$TEST_IMG
fi
qemu_comm_method="monitor"
_launch_qemu -drive $DRIVE_ARG -incoming defer
h=$QEMU_HANDLE
QEMU_COMM_TIMEOUT=1
_send_qemu_cmd $h "nbd_server_start unix:$TEST_DIR/nbd" "(qemu)"
_send_qemu_cmd $h "nbd_server_add -w drive0" "(qemu)"
_send_qemu_cmd $h "q" "(qemu)"
# success, all done
echo "*** done"

View file

@ -21,6 +21,7 @@
import iotests
iotests.verify_image_format(unsupported_fmts=['luks'])
iotests.verify_platform(['linux'])
with iotests.FilePath('source.img') as source_img_path, \

View file

@ -421,9 +421,11 @@ def notrun(reason):
print '%s not run: %s' % (seq, reason)
sys.exit(0)
def verify_image_format(supported_fmts=[]):
def verify_image_format(supported_fmts=[], unsupported_fmts=[]):
if supported_fmts and (imgfmt not in supported_fmts):
notrun('not suitable for this image format: %s' % imgfmt)
if unsupported_fmts and (imgfmt in unsupported_fmts):
notrun('not suitable for this image format: %s' % imgfmt)
def verify_platform(supported_oses=['linux']):
if True not in [sys.platform.startswith(x) for x in supported_oses]: