Commit afccfc0c authored by Peter Maydell's avatar Peter Maydell
Browse files

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: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 13c24eda 9749636b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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 ==="
+3 −3
Original line number Diff line number Diff line
@@ -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 ===

+8 −2
Original line number Diff line number Diff line
@@ -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