1
The following changes since commit 2ab09bf2f9f55b9fb8d2de6eb2ba2a8570e268e2:
1
The following changes since commit 346ed3151f1c43e72c40cb55b392a1d4cface62c:
2
2
3
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20180612-pull-request' into staging (2018-06-12 15:34:34 +0100)
3
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20200206.0' into staging (2020-02-07 11:52:15 +0000)
4
4
5
are available in the git repository at:
5
are available in the Git repository at:
6
6
7
git://github.com/codyprime/qemu-kvm-jtc.git tags/block-pull-request
7
https://github.com/stefanha/qemu.git tags/block-pull-request
8
8
9
for you to fetch changes up to b61acdecbf19c3c5a327baec1e8e4c06d0da68b7:
9
for you to fetch changes up to 11a18c84db4a71497d3d40769688a01b6f64b2ad:
10
10
11
block: Ignore generated job QAPI files (2018-06-13 10:51:49 -0400)
11
hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host (2020-02-07 16:49:39 +0000)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Block patch for .gitignore
14
Pull request
15
15
----------------------------------------------------------------
16
----------------------------------------------------------------
16
17
17
Eric Blake (1):
18
Philippe Mathieu-Daudé (1):
18
block: Ignore generated job QAPI files
19
hw/core: Allow setting 'virtio-blk-device.scsi' property on OSX host
19
20
20
.gitignore | 4 ++++
21
Vladimir Sementsov-Ogievskiy (1):
21
1 file changed, 4 insertions(+)
22
block: fix crash on zero-length unaligned write and read
23
24
block/io.c | 28 +++++++++++++++++++++++++++-
25
hw/core/machine.c | 3 ++-
26
2 files changed, 29 insertions(+), 2 deletions(-)
22
27
23
--
28
--
24
2.13.6
29
2.24.1
25
30
26
31
diff view generated by jsdifflib
New patch
1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
1
2
3
Commit 7a3f542fbd "block/io: refactor padding" occasionally dropped
4
aligning for zero-length request: bdrv_init_padding() blindly return
5
false if bytes == 0, like there is nothing to align.
6
7
This leads the following command to crash:
8
9
./qemu-io --image-opts -c 'write 1 0' \
10
driver=blkdebug,align=512,image.driver=null-co,image.size=512
11
12
>> qemu-io: block/io.c:1955: bdrv_aligned_pwritev: Assertion
13
`(offset & (align - 1)) == 0' failed.
14
>> Aborted (core dumped)
15
16
Prior to 7a3f542fbd we does aligning of such zero requests. Instead of
17
recovering this behavior let's just do nothing on such requests as it
18
is useless.
19
20
Note that driver may have special meaning of zero-length reqeusts, like
21
qcow2_co_pwritev_compressed_part, so we can't skip any zero-length
22
operation. But for unaligned ones, we can't pass it to driver anyway.
23
24
This commit also fixes crash in iotest 80 running with -nocache:
25
26
./check -nocache -qcow2 80
27
28
which crashes on same assertion due to trying to read empty extra data
29
in qcow2_do_read_snapshots().
30
31
Cc: qemu-stable@nongnu.org # v4.2
32
Fixes: 7a3f542fbd
33
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
34
Reviewed-by: Max Reitz <mreitz@redhat.com>
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
--- a/block/io.c
44
+++ b/block/io.c
45
@@ -XXX,XX +XXX,XX @@ static bool bdrv_init_padding(BlockDriverState *bs,
46
pad->tail = align - pad->tail;
47
}
48
49
- if ((!pad->head && !pad->tail) || !bytes) {
50
+ if (!pad->head && !pad->tail) {
51
return false;
52
}
53
54
+ assert(bytes); /* Nothing good in aligning zero-length requests */
55
+
56
sum = pad->head + bytes + pad->tail;
57
pad->buf_len = (sum > align && pad->head && pad->tail) ? 2 * align : align;
58
pad->buf = qemu_blockalign(bs, pad->buf_len);
59
@@ -XXX,XX +XXX,XX @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child,
60
return ret;
61
}
62
63
+ if (bytes == 0 && !QEMU_IS_ALIGNED(offset, bs->bl.request_alignment)) {
64
+ /*
65
+ * Aligning zero request is nonsense. Even if driver has special meaning
66
+ * of zero-length (like qcow2_co_pwritev_compressed_part), we can't pass
67
+ * it to driver due to request_alignment.
68
+ *
69
+ * Still, no reason to return an error if someone do unaligned
70
+ * zero-length read occasionally.
71
+ */
72
+ return 0;
73
+ }
74
+
75
bdrv_inc_in_flight(bs);
76
77
/* Don't do copy-on-read if we read data before write operation */
78
@@ -XXX,XX +XXX,XX @@ int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child,
79
return -ENOTSUP;
80
}
81
82
+ if (bytes == 0 && !QEMU_IS_ALIGNED(offset, bs->bl.request_alignment)) {
83
+ /*
84
+ * Aligning zero request is nonsense. Even if driver has special meaning
85
+ * of zero-length (like qcow2_co_pwritev_compressed_part), we can't pass
86
+ * it to driver due to request_alignment.
87
+ *
88
+ * Still, no reason to return an error if someone do unaligned
89
+ * zero-length write occasionally.
90
+ */
91
+ return 0;
92
+ }
93
+
94
bdrv_inc_in_flight(bs);
95
/*
96
* Align write if necessary by performing a read-modify-write cycle.
97
--
98
2.24.1
99
100
diff view generated by jsdifflib
1
From: Eric Blake <eblake@redhat.com>
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
2
2
3
Commit bf42508f introduced new generated files; make sure they
3
Commit ed65fd1a2750 ("virtio-blk: switch off scsi-passthrough by
4
don't get accidentally committed from an in-tree build.
4
default") changed the default value of the 'scsi' property of
5
virtio-blk, which is only available on Linux hosts. It also added
6
an unconditional compat entry for 2.4 or earlier machines.
5
7
6
Signed-off-by: Eric Blake <eblake@redhat.com>
8
Trying to set this property on a pre-2.5 machine on OSX, we get:
7
Reviewed-by: Jeff Cody <jcody@redhat.com>
9
8
Reviewed-by: Max Reitz <mreitz@redhat.com>
10
Unexpected error in object_property_find() at qom/object.c:1201:
9
Message-id: 20180531212435.165261-1-eblake@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
10
Signed-off-by: Jeff Cody <jcody@redhat.com>
12
13
Fix this error by marking the property optional.
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>
11
---
22
---
12
.gitignore | 4 ++++
23
hw/core/machine.c | 3 ++-
13
1 file changed, 4 insertions(+)
24
1 file changed, 2 insertions(+), 1 deletion(-)
14
25
15
diff --git a/.gitignore b/.gitignore
26
diff --git a/hw/core/machine.c b/hw/core/machine.c
16
index XXXXXXX..XXXXXXX 100644
27
index XXXXXXX..XXXXXXX 100644
17
--- a/.gitignore
28
--- a/hw/core/machine.c
18
+++ b/.gitignore
29
+++ b/hw/core/machine.c
19
@@ -XXX,XX +XXX,XX @@
30
@@ -XXX,XX +XXX,XX @@ GlobalProperty hw_compat_2_5[] = {
20
/qapi/qapi-commands-common.[ch]
31
const size_t hw_compat_2_5_len = G_N_ELEMENTS(hw_compat_2_5);
21
/qapi/qapi-commands-crypto.[ch]
32
22
/qapi/qapi-commands-introspect.[ch]
33
GlobalProperty hw_compat_2_4[] = {
23
+/qapi/qapi-commands-job.[ch]
34
- { "virtio-blk-device", "scsi", "true" },
24
/qapi/qapi-commands-migration.[ch]
35
+ /* Optional because the 'scsi' property is Linux-only */
25
/qapi/qapi-commands-misc.[ch]
36
+ { "virtio-blk-device", "scsi", "true", .optional = true },
26
/qapi/qapi-commands-net.[ch]
37
{ "e1000", "extra_mac_registers", "off" },
27
@@ -XXX,XX +XXX,XX @@
38
{ "virtio-pci", "x-disable-pcie", "on" },
28
/qapi/qapi-events-common.[ch]
39
{ "virtio-pci", "migrate-extra", "off" },
29
/qapi/qapi-events-crypto.[ch]
30
/qapi/qapi-events-introspect.[ch]
31
+/qapi/qapi-events-job.[ch]
32
/qapi/qapi-events-migration.[ch]
33
/qapi/qapi-events-misc.[ch]
34
/qapi/qapi-events-net.[ch]
35
@@ -XXX,XX +XXX,XX @@
36
/qapi/qapi-types-common.[ch]
37
/qapi/qapi-types-crypto.[ch]
38
/qapi/qapi-types-introspect.[ch]
39
+/qapi/qapi-types-job.[ch]
40
/qapi/qapi-types-migration.[ch]
41
/qapi/qapi-types-misc.[ch]
42
/qapi/qapi-types-net.[ch]
43
@@ -XXX,XX +XXX,XX @@
44
/qapi/qapi-visit-common.[ch]
45
/qapi/qapi-visit-crypto.[ch]
46
/qapi/qapi-visit-introspect.[ch]
47
+/qapi/qapi-visit-job.[ch]
48
/qapi/qapi-visit-migration.[ch]
49
/qapi/qapi-visit-misc.[ch]
50
/qapi/qapi-visit-net.[ch]
51
--
40
--
52
2.13.6
41
2.24.1
53
42
54
43
diff view generated by jsdifflib