Block layer patches:

- iotests fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJcsLb5AAoJEH8JsnLIjy/WtTIQAJBiNOGPVQoenGjxUhacFLB2
 Lylqif8kc0OXemhyiu6V36HCQbUH6+QY1NyjStiJXfzd9yMLyRpOFPhnZpfOZJuh
 xNeln6GxmSDyD5d+NlfVVvJylDzk13mV/s3RkTkw0VW7FwygfMWH4h7pa8jJT/b6
 dFdvBZB/+GhhYUVquxiNSYgIQ5KwK/oovZQnkeq//KVSf2wdHq9i7dvIT4BIXj5Z
 aINQlk48OBmlGmevMzhS99AKZpAz2j4zGVagrwj9dCrkDc29d1TOw75UcPTLw0OS
 2FqhHI+P435+O5VTQxEVW0sx5C5N8FNkjsA0E33XkgdSLHZSFWuyG73H8HtjwCkB
 BuQ3G+JQ5AexvCWdz+zBaE/aKbmcopasXcpzV+DxXVBXmj6Gx7rMvKY8RYiBwZWc
 oIPUCPc2vwKgnx3KPnAAJoKbhpiEhiXPQam20rIoySyzuEDHOQN/kiDQQB+b+PPK
 aYkdWHknkurG+ioUq1F5OwCw5cOw1AKbVNmtRFKD59wBQB/G/gDGgtlWhEALFMyf
 0ZpKaH+c+QJPbaMagCMgwPJ8DgKLb6yJGLwmK/M2CbIYW/2bVMel65YRT67Z+l2H
 Va0vxFqMeVkSRcezUAAXbxMaaLHa9AMQV1V+KAXguYPa7Uqz7p05d9N88r7q87Ui
 FNE+xchmUSdS695h0Gkl
 =46wR
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- iotests fixes

# gpg: Signature made Fri 12 Apr 2019 17:04:09 BST
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  iotest: Fix 241 to run in generic directory
  iotests: Let 245 pass on tmpfs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2019-04-12 17:06:49 +01:00
commit afccfc0c4c
3 changed files with 14 additions and 6 deletions

View File

@ -28,6 +28,7 @@ nbd_unix_socket=$TEST_DIR/test_qemu_nbd_socket
_cleanup()
{
_cleanup_test_img
rm -f "$TEST_DIR/server.log"
nbd_server_stop
}
trap "_cleanup; exit \$status" 0 1 2 3 15
@ -69,12 +70,13 @@ echo
# Intentionally omit '-f' to force image probing, which in turn forces
# sector alignment, here at the server.
nbd_server_start_unix_socket "$TEST_IMG_FILE"
nbd_server_start_unix_socket "$TEST_IMG_FILE" 2> "$TEST_DIR/server.log"
$QEMU_NBD_PROG --list -k $nbd_unix_socket | grep '\(size\|min\)'
$QEMU_IMG map -f raw --output=json "$TEST_IMG" | _filter_qemu_img_map
$QEMU_IO -f raw -c map "$TEST_IMG"
nbd_server_stop
cat "$TEST_DIR/server.log" | _filter_testdir
echo
echo "=== Exporting unaligned raw image, forced client sector alignment ==="

View File

@ -10,13 +10,13 @@ QA output created by 241
=== Exporting unaligned raw image, forced server sector alignment ===
WARNING: Image format was not specified for '/home/eblake/qemu/tests/qemu-iotests/scratch/t.raw' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
size: 1024
min block: 512
[{ "start": 0, "length": 1024, "depth": 0, "zero": false, "data": true, "offset": OFFSET}]
1 KiB (0x400) bytes allocated at offset 0 bytes (0x0)
WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
=== Exporting unaligned raw image, forced client sector alignment ===

View File

@ -209,6 +209,12 @@ class TestBlockdevReopen(iotests.QMPTestCase):
# Reopen an image several times changing some of its options
def test_reopen(self):
# Check whether the filesystem supports O_DIRECT
if 'O_DIRECT' in qemu_io('-f', 'raw', '-t', 'none', '-c', 'quit', hd_path[0]):
supports_direct = False
else:
supports_direct = True
# Open the hd1 image passing all backing options
opts = hd_opts(1)
opts['backing'] = hd_opts(0)
@ -231,9 +237,9 @@ class TestBlockdevReopen(iotests.QMPTestCase):
self.assert_qmp(self.get_node('hd1'), 'cache/writeback', True)
self.assert_qmp(self.get_node('hd1'), 'cache/direct', False)
self.assert_qmp(self.get_node('hd1'), 'cache/no-flush', False)
self.reopen(opts, {'cache': { 'direct': True, 'no-flush': True }})
self.reopen(opts, {'cache': { 'direct': supports_direct, 'no-flush': True }})
self.assert_qmp(self.get_node('hd1'), 'cache/writeback', True)
self.assert_qmp(self.get_node('hd1'), 'cache/direct', True)
self.assert_qmp(self.get_node('hd1'), 'cache/direct', supports_direct)
self.assert_qmp(self.get_node('hd1'), 'cache/no-flush', True)
# Reopen again with the original options