1 | The following changes since commit 346ed3151f1c43e72c40cb55b392a1d4cface62c: | 1 | The following changes since commit d88d5a3806d78dcfca648c62dae9d88d3e803bd2: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20200206.0' into staging (2020-02-07 11:52:15 +0000) | 3 | Merge remote-tracking branch 'remotes/philmd-gitlab/tags/renesas-hw-20200622' into staging (2020-06-23 13:55:52 +0100) |
4 | 4 | ||
5 | are available in the Git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | https://github.com/stefanha/qemu.git tags/block-pull-request | 7 | https://github.com/XanClic/qemu.git tags/pull-block-2020-06-24 |
8 | 8 | ||
9 | for you to fetch changes up to 11a18c84db4a71497d3d40769688a01b6f64b2ad: | 9 | for you to fetch changes up to 24b861c0386a17ea31eb824310c21118fb7be883: |
10 | 10 | ||
11 | hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host (2020-02-07 16:49:39 +0000) | 11 | iotests: don't test qcow2.py inside 291 (2020-06-24 10:00:04 +0200) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Pull request | 14 | Block patches: |
15 | - Two iotest fixes | ||
15 | 16 | ||
16 | ---------------------------------------------------------------- | 17 | ---------------------------------------------------------------- |
17 | 18 | This is v2, where I dropped Maxim’s LUKS keyslot amendment series and my | |
19 | iotest patches, because both caused iotest failures on some test | ||
20 | machines. | ||
21 | ---------------------------------------------------------------- | ||
18 | Philippe Mathieu-Daudé (1): | 22 | Philippe Mathieu-Daudé (1): |
19 | hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host | 23 | iotests: Fix 051 output after qdev_init_nofail() removal |
20 | 24 | ||
21 | Vladimir Sementsov-Ogievskiy (1): | 25 | Vladimir Sementsov-Ogievskiy (1): |
22 | block: fix crash on zero-length unaligned write and read | 26 | iotests: don't test qcow2.py inside 291 |
23 | 27 | ||
24 | block/io.c | 28 +++++++++++++++++++++++++++- | 28 | tests/qemu-iotests/051.pc.out | 4 ++-- |
25 | hw/core/machine.c | 3 ++- | 29 | tests/qemu-iotests/291 | 4 ---- |
26 | 2 files changed, 29 insertions(+), 2 deletions(-) | 30 | tests/qemu-iotests/291.out | 33 --------------------------------- |
31 | 3 files changed, 2 insertions(+), 39 deletions(-) | ||
27 | 32 | ||
28 | -- | 33 | -- |
29 | 2.24.1 | 34 | 2.26.2 |
30 | 35 | ||
31 | 36 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Commit ed65fd1a2750 ("virtio-blk: switch off scsi-passthrough by | 3 | Commit 96927c744 replaced qdev_init_nofail() call by |
4 | default") changed the default value of the 'scsi' property of | 4 | isa_realize_and_unref() which has a different error |
5 | virtio-blk, which is only available on Linux hosts. It also added | 5 | message. Update the test output accordingly. |
6 | an unconditional compat entry for 2.4 or earlier machines. | ||
7 | 6 | ||
8 | Trying to set this property on a pre-2.5 machine on OSX, we get: | 7 | Gitlab CI error after merging b77b5b3dc7: |
8 | https://gitlab.com/qemu-project/qemu/-/jobs/597414772#L4375 | ||
9 | 9 | ||
10 | Unexpected error in object_property_find() at qom/object.c:1201: | 10 | Reported-by: Thomas Huth <thuth@redhat.com> |
11 | qemu-system-x86_64: -device virtio-blk-pci,id=scsi0,drive=drive0: can't apply global virtio-blk-device.scsi=true: Property '.scsi' not found | 11 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
12 | Message-Id: <20200616154949.6586-1-philmd@redhat.com> | ||
13 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
14 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
15 | --- | ||
16 | tests/qemu-iotests/051.pc.out | 4 ++-- | ||
17 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
12 | 18 | ||
13 | Fix this error by marking the property optional. | 19 | diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out |
14 | |||
15 | Fixes: ed65fd1a27 ("virtio-blk: switch off scsi-passthrough by default") | ||
16 | Suggested-by: Cornelia Huck <cohuck@redhat.com> | ||
17 | Reviewed-by: Cornelia Huck <cohuck@redhat.com> | ||
18 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
19 | Reviewed-by: Michael S. Tsirkin <mst@redhat.com> | ||
20 | Message-id: 20200207001404.1739-1-philmd@redhat.com | ||
21 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
22 | --- | ||
23 | hw/core/machine.c | 3 ++- | ||
24 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
25 | |||
26 | diff --git a/hw/core/machine.c b/hw/core/machine.c | ||
27 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
28 | --- a/hw/core/machine.c | 21 | --- a/tests/qemu-iotests/051.pc.out |
29 | +++ b/hw/core/machine.c | 22 | +++ b/tests/qemu-iotests/051.pc.out |
30 | @@ -XXX,XX +XXX,XX @@ GlobalProperty hw_compat_2_5[] = { | 23 | @@ -XXX,XX +XXX,XX @@ QEMU X.Y.Z monitor - type 'help' for more information |
31 | const size_t hw_compat_2_5_len = G_N_ELEMENTS(hw_compat_2_5); | 24 | |
32 | 25 | Testing: -drive if=ide | |
33 | GlobalProperty hw_compat_2_4[] = { | 26 | QEMU X.Y.Z monitor - type 'help' for more information |
34 | - { "virtio-blk-device", "scsi", "true" }, | 27 | -(qemu) QEMU_PROG: Initialization of device ide-hd failed: Device needs media, but drive is empty |
35 | + /* Optional because the 'scsi' property is Linux-only */ | 28 | +(qemu) QEMU_PROG: Device needs media, but drive is empty |
36 | + { "virtio-blk-device", "scsi", "true", .optional = true }, | 29 | |
37 | { "e1000", "extra_mac_registers", "off" }, | 30 | Testing: -drive if=virtio |
38 | { "virtio-pci", "x-disable-pcie", "on" }, | 31 | QEMU X.Y.Z monitor - type 'help' for more information |
39 | { "virtio-pci", "migrate-extra", "off" }, | 32 | @@ -XXX,XX +XXX,XX @@ QEMU X.Y.Z monitor - type 'help' for more information |
33 | |||
34 | Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on | ||
35 | QEMU X.Y.Z monitor - type 'help' for more information | ||
36 | -(qemu) QEMU_PROG: Initialization of device ide-hd failed: Block node is read-only | ||
37 | +(qemu) QEMU_PROG: Block node is read-only | ||
38 | |||
39 | Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on | ||
40 | QEMU X.Y.Z monitor - type 'help' for more information | ||
40 | -- | 41 | -- |
41 | 2.24.1 | 42 | 2.26.2 |
42 | 43 | ||
43 | 44 | diff view generated by jsdifflib |
1 | From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 1 | From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> |
---|---|---|---|
2 | 2 | ||
3 | Commit 7a3f542fbd "block/io: refactor padding" occasionally dropped | 3 | 820c6bee534ec3b added testing of qcow2.py into 291, and it breaks 291 |
4 | aligning for zero-length request: bdrv_init_padding() blindly return | 4 | with external data file. Actually, 291 is bad place for qcow2.py |
5 | false if bytes == 0, like there is nothing to align. | 5 | testing, better add a separate test. |
6 | 6 | ||
7 | This leads the following command to crash: | 7 | For now, drop qcow2.py testing from 291 to fix the regression. |
8 | 8 | ||
9 | ./qemu-io --image-opts -c 'write 1 0' \ | 9 | Fixes: 820c6bee534ec3b |
10 | driver=blkdebug,align=512,image.driver=null-co,image.size=512 | 10 | Reported-by: Max Reitz <mreitz@redhat.com> |
11 | Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | ||
12 | Message-Id: <20200618154052.8629-1-vsementsov@virtuozzo.com> | ||
13 | Reviewed-by: Eric Blake <eblake@redhat.com> | ||
14 | Signed-off-by: Max Reitz <mreitz@redhat.com> | ||
15 | --- | ||
16 | tests/qemu-iotests/291 | 4 ---- | ||
17 | tests/qemu-iotests/291.out | 33 --------------------------------- | ||
18 | 2 files changed, 37 deletions(-) | ||
11 | 19 | ||
12 | >> qemu-io: block/io.c:1955: bdrv_aligned_pwritev: Assertion | 20 | diff --git a/tests/qemu-iotests/291 b/tests/qemu-iotests/291 |
13 | `(offset & (align - 1)) == 0' failed. | 21 | index XXXXXXX..XXXXXXX 100755 |
14 | >> Aborted (core dumped) | 22 | --- a/tests/qemu-iotests/291 |
15 | 23 | +++ b/tests/qemu-iotests/291 | |
16 | Prior to 7a3f542fbd we does aligning of such zero requests. Instead of | 24 | @@ -XXX,XX +XXX,XX @@ $QEMU_IO -c 'w 1M 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io |
17 | recovering this behavior let's just do nothing on such requests as it | 25 | $QEMU_IMG bitmap --disable -f $IMGFMT "$TEST_IMG" b1 |
18 | is useless. | 26 | $QEMU_IMG bitmap --enable -f $IMGFMT "$TEST_IMG" b2 |
19 | 27 | $QEMU_IO -c 'w 2M 1M' -f $IMGFMT "$TEST_IMG" | _filter_qemu_io | |
20 | Note that driver may have special meaning of zero-length reqeusts, like | 28 | -echo "Check resulting qcow2 header extensions:" |
21 | qcow2_co_pwritev_compressed_part, so we can't skip any zero-length | 29 | -$PYTHON qcow2.py "$TEST_IMG" dump-header-exts |
22 | operation. But for unaligned ones, we can't pass it to driver anyway. | 30 | |
23 | 31 | echo | |
24 | This commit also fixes crash in iotest 80 running with -nocache: | 32 | echo "=== Bitmap preservation not possible to non-qcow2 ===" |
25 | 33 | @@ -XXX,XX +XXX,XX @@ $QEMU_IMG bitmap --merge tmp -f $IMGFMT "$TEST_IMG" b0 | |
26 | ./check -nocache -qcow2 80 | 34 | $QEMU_IMG bitmap --remove --image-opts \ |
27 | 35 | driver=$IMGFMT,file.driver=file,file.filename="$TEST_IMG" tmp | |
28 | which crashes on same assertion due to trying to read empty extra data | 36 | _img_info --format-specific |
29 | in qcow2_do_read_snapshots(). | 37 | -echo "Check resulting qcow2 header extensions:" |
30 | 38 | -$PYTHON qcow2.py "$TEST_IMG" dump-header-exts | |
31 | Cc: qemu-stable@nongnu.org # v4.2 | 39 | |
32 | Fixes: 7a3f542fbd | 40 | echo |
33 | Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 41 | echo "=== Check bitmap contents ===" |
34 | Reviewed-by: Max Reitz <mreitz@redhat.com> | 42 | diff --git a/tests/qemu-iotests/291.out b/tests/qemu-iotests/291.out |
35 | Message-id: 20200206164245.17781-1-vsementsov@virtuozzo.com | ||
36 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
37 | --- | ||
38 | block/io.c | 28 +++++++++++++++++++++++++++- | ||
39 | 1 file changed, 27 insertions(+), 1 deletion(-) | ||
40 | |||
41 | diff --git a/block/io.c b/block/io.c | ||
42 | index XXXXXXX..XXXXXXX 100644 | 43 | index XXXXXXX..XXXXXXX 100644 |
43 | --- a/block/io.c | 44 | --- a/tests/qemu-iotests/291.out |
44 | +++ b/block/io.c | 45 | +++ b/tests/qemu-iotests/291.out |
45 | @@ -XXX,XX +XXX,XX @@ static bool bdrv_init_padding(BlockDriverState *bs, | 46 | @@ -XXX,XX +XXX,XX @@ wrote 1048576/1048576 bytes at offset 1048576 |
46 | pad->tail = align - pad->tail; | 47 | 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) |
47 | } | 48 | wrote 1048576/1048576 bytes at offset 2097152 |
48 | 49 | 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) | |
49 | - if ((!pad->head && !pad->tail) || !bytes) { | 50 | -Check resulting qcow2 header extensions: |
50 | + if (!pad->head && !pad->tail) { | 51 | -Header extension: |
51 | return false; | 52 | -magic 0xe2792aca (Backing format) |
52 | } | 53 | -length 5 |
53 | 54 | -data 'qcow2' | |
54 | + assert(bytes); /* Nothing good in aligning zero-length requests */ | 55 | - |
55 | + | 56 | -Header extension: |
56 | sum = pad->head + bytes + pad->tail; | 57 | -magic 0x6803f857 (Feature table) |
57 | pad->buf_len = (sum > align && pad->head && pad->tail) ? 2 * align : align; | 58 | -length 336 |
58 | pad->buf = qemu_blockalign(bs, pad->buf_len); | 59 | -data <binary> |
59 | @@ -XXX,XX +XXX,XX @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child, | 60 | - |
60 | return ret; | 61 | -Header extension: |
61 | } | 62 | -magic 0x23852875 (Bitmaps) |
62 | 63 | -length 24 | |
63 | + if (bytes == 0 && !QEMU_IS_ALIGNED(offset, bs->bl.request_alignment)) { | 64 | -nb_bitmaps 2 |
64 | + /* | 65 | -reserved32 0 |
65 | + * Aligning zero request is nonsense. Even if driver has special meaning | 66 | -bitmap_directory_size 0x40 |
66 | + * of zero-length (like qcow2_co_pwritev_compressed_part), we can't pass | 67 | -bitmap_directory_offset 0x510000 |
67 | + * it to driver due to request_alignment. | 68 | - |
68 | + * | 69 | |
69 | + * Still, no reason to return an error if someone do unaligned | 70 | === Bitmap preservation not possible to non-qcow2 === |
70 | + * zero-length read occasionally. | 71 | |
71 | + */ | 72 | @@ -XXX,XX +XXX,XX @@ Format specific information: |
72 | + return 0; | 73 | granularity: 65536 |
73 | + } | 74 | refcount bits: 16 |
74 | + | 75 | corrupt: false |
75 | bdrv_inc_in_flight(bs); | 76 | -Check resulting qcow2 header extensions: |
76 | 77 | -Header extension: | |
77 | /* Don't do copy-on-read if we read data before write operation */ | 78 | -magic 0x6803f857 (Feature table) |
78 | @@ -XXX,XX +XXX,XX @@ int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child, | 79 | -length 336 |
79 | return -ENOTSUP; | 80 | -data <binary> |
80 | } | 81 | - |
81 | 82 | -Header extension: | |
82 | + if (bytes == 0 && !QEMU_IS_ALIGNED(offset, bs->bl.request_alignment)) { | 83 | -magic 0x23852875 (Bitmaps) |
83 | + /* | 84 | -length 24 |
84 | + * Aligning zero request is nonsense. Even if driver has special meaning | 85 | -nb_bitmaps 3 |
85 | + * of zero-length (like qcow2_co_pwritev_compressed_part), we can't pass | 86 | -reserved32 0 |
86 | + * it to driver due to request_alignment. | 87 | -bitmap_directory_size 0x60 |
87 | + * | 88 | -bitmap_directory_offset 0x520000 |
88 | + * Still, no reason to return an error if someone do unaligned | 89 | - |
89 | + * zero-length write occasionally. | 90 | |
90 | + */ | 91 | === Check bitmap contents === |
91 | + return 0; | 92 | |
92 | + } | ||
93 | + | ||
94 | bdrv_inc_in_flight(bs); | ||
95 | /* | ||
96 | * Align write if necessary by performing a read-modify-write cycle. | ||
97 | -- | 93 | -- |
98 | 2.24.1 | 94 | 2.26.2 |
99 | 95 | ||
100 | 96 | diff view generated by jsdifflib |