1
The following changes since commit 0b5e750bea635b167eb03d86c3d9a09bbd43bc06:
1
The following changes since commit 3521ade3510eb5cefb2e27a101667f25dad89935:
2
2
3
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2019-02-12 10:53:37 +0000)
3
Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-07-29' into staging (2021-07-29 13:17:20 +0100)
4
4
5
are available in the Git repository at:
5
are available in the Git repository at:
6
6
7
git://github.com/stefanha/qemu.git tags/block-pull-request
7
https://gitlab.com/stefanha/qemu.git tags/block-pull-request
8
8
9
for you to fetch changes up to 42824b4d16da56a50ff4027f6cd22378e0e2666e:
9
for you to fetch changes up to cc8eecd7f105a1dff5876adeb238a14696061a4a:
10
10
11
virtio-blk: set correct config size for the host driver (2019-02-13 16:18:17 +0800)
11
MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver (2021-07-29 17:17:34 +0100)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Pull request
14
Pull request
15
15
16
Fix a virtio-blk migration regression.
16
The main fix here is for io_uring. Spurious -EAGAIN errors can happen and the
17
request needs to be resubmitted.
18
19
The MAINTAINERS changes carry no risk and we might as well include them in QEMU
20
6.1.
17
21
18
----------------------------------------------------------------
22
----------------------------------------------------------------
19
23
20
Changpeng Liu (1):
24
Fabian Ebner (1):
21
virtio-blk: set correct config size for the host driver
25
block/io_uring: resubmit when result is -EAGAIN
22
26
23
hw/block/virtio-blk.c | 13 +++++++++----
27
Philippe Mathieu-Daudé (1):
24
1 file changed, 9 insertions(+), 4 deletions(-)
28
MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver
29
30
Stefano Garzarella (1):
31
MAINTAINERS: add Stefano Garzarella as io_uring reviewer
32
33
MAINTAINERS | 2 ++
34
block/io_uring.c | 16 +++++++++++++++-
35
2 files changed, 17 insertions(+), 1 deletion(-)
25
36
26
--
37
--
27
2.20.1
38
2.31.1
28
39
29
diff view generated by jsdifflib
New patch
1
From: Stefano Garzarella <sgarzare@redhat.com>
1
2
3
I've been working with io_uring for a while so I'd like to help
4
with reviews.
5
6
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
7
Message-Id: <20210728131515.131045-1-sgarzare@redhat.com>
8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
---
10
MAINTAINERS | 1 +
11
1 file changed, 1 insertion(+)
12
13
diff --git a/MAINTAINERS b/MAINTAINERS
14
index XXXXXXX..XXXXXXX 100644
15
--- a/MAINTAINERS
16
+++ b/MAINTAINERS
17
@@ -XXX,XX +XXX,XX @@ Linux io_uring
18
M: Aarushi Mehta <mehta.aaru20@gmail.com>
19
M: Julia Suvorova <jusual@redhat.com>
20
M: Stefan Hajnoczi <stefanha@redhat.com>
21
+R: Stefano Garzarella <sgarzare@redhat.com>
22
L: qemu-block@nongnu.org
23
S: Maintained
24
F: block/io_uring.c
25
--
26
2.31.1
27
diff view generated by jsdifflib
New patch
1
From: Fabian Ebner <f.ebner@proxmox.com>
1
2
3
Linux SCSI can throw spurious -EAGAIN in some corner cases in its
4
completion path, which will end up being the result in the completed
5
io_uring request.
6
7
Resubmitting such requests should allow block jobs to complete, even
8
if such spurious errors are encountered.
9
10
Co-authored-by: Stefan Hajnoczi <stefanha@gmail.com>
11
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
12
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
13
Message-id: 20210729091029.65369-1-f.ebner@proxmox.com
14
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
15
---
16
block/io_uring.c | 16 +++++++++++++++-
17
1 file changed, 15 insertions(+), 1 deletion(-)
18
19
diff --git a/block/io_uring.c b/block/io_uring.c
20
index XXXXXXX..XXXXXXX 100644
21
--- a/block/io_uring.c
22
+++ b/block/io_uring.c
23
@@ -XXX,XX +XXX,XX @@ static void luring_process_completions(LuringState *s)
24
total_bytes = ret + luringcb->total_read;
25
26
if (ret < 0) {
27
- if (ret == -EINTR) {
28
+ /*
29
+ * Only writev/readv/fsync requests on regular files or host block
30
+ * devices are submitted. Therefore -EAGAIN is not expected but it's
31
+ * known to happen sometimes with Linux SCSI. Submit again and hope
32
+ * the request completes successfully.
33
+ *
34
+ * For more information, see:
35
+ * https://lore.kernel.org/io-uring/20210727165811.284510-3-axboe@kernel.dk/T/#u
36
+ *
37
+ * If the code is changed to submit other types of requests in the
38
+ * future, then this workaround may need to be extended to deal with
39
+ * genuine -EAGAIN results that should not be resubmitted
40
+ * immediately.
41
+ */
42
+ if (ret == -EINTR || ret == -EAGAIN) {
43
luring_resubmit(s, luringcb);
44
continue;
45
}
46
--
47
2.31.1
48
diff view generated by jsdifflib
1
From: Changpeng Liu <changpeng.liu@intel.com>
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
2
2
3
Commit caa1ee43 "vhost-user-blk: add discard/write zeroes features
3
I'm interested in following the activity around the NVMe bdrv.
4
support" added fields to struct virtio_blk_config. This changes
5
the size of the config space and breaks migration from QEMU 3.1
6
and older:
7
4
8
qemu-system-ppc64: get_pci_config_device: Bad config data: i=0x10 read: 41 device: 1 cmask: ff wmask: 80 w1cmask:0
5
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
9
qemu-system-ppc64: Failed to load PCIDevice:config
6
Message-id: 20210728183340.2018313-1-philmd@redhat.com
10
qemu-system-ppc64: Failed to load virtio-blk:virtio
11
qemu-system-ppc64: error while loading state for instance 0x0 of device 'pci@800000020000000:01.0/virtio-blk'
12
qemu-system-ppc64: load of migration failed: Invalid argument
13
14
Since virtio-blk doesn't support the "discard" and "write zeroes"
15
features, it shouldn't even expose the associated fields in the
16
config space actually. Just include all fields up to num_queues to
17
match QEMU 3.1 and older.
18
19
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
20
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
21
Message-id: 1550022537-27565-1-git-send-email-changpeng.liu@intel.com
22
Message-Id: <1550022537-27565-1-git-send-email-changpeng.liu@intel.com>
23
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
24
---
8
---
25
hw/block/virtio-blk.c | 13 +++++++++----
9
MAINTAINERS | 1 +
26
1 file changed, 9 insertions(+), 4 deletions(-)
10
1 file changed, 1 insertion(+)
27
11
28
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
12
diff --git a/MAINTAINERS b/MAINTAINERS
29
index XXXXXXX..XXXXXXX 100644
13
index XXXXXXX..XXXXXXX 100644
30
--- a/hw/block/virtio-blk.c
14
--- a/MAINTAINERS
31
+++ b/hw/block/virtio-blk.c
15
+++ b/MAINTAINERS
32
@@ -XXX,XX +XXX,XX @@
16
@@ -XXX,XX +XXX,XX @@ F: block/null.c
33
#include "hw/virtio/virtio-bus.h"
17
NVMe Block Driver
34
#include "hw/virtio/virtio-access.h"
18
M: Stefan Hajnoczi <stefanha@redhat.com>
35
19
R: Fam Zheng <fam@euphon.net>
36
+/* We don't support discard yet, hide associated config fields. */
20
+R: Philippe Mathieu-Daudé <philmd@redhat.com>
37
+#define VIRTIO_BLK_CFG_SIZE offsetof(struct virtio_blk_config, \
21
L: qemu-block@nongnu.org
38
+ max_discard_sectors)
22
S: Supported
39
+
23
F: block/nvme*
40
static void virtio_blk_init_request(VirtIOBlock *s, VirtQueue *vq,
41
VirtIOBlockReq *req)
42
{
43
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
44
blkcfg.alignment_offset = 0;
45
blkcfg.wce = blk_enable_write_cache(s->blk);
46
virtio_stw_p(vdev, &blkcfg.num_queues, s->conf.num_queues);
47
- memcpy(config, &blkcfg, sizeof(struct virtio_blk_config));
48
+ memcpy(config, &blkcfg, VIRTIO_BLK_CFG_SIZE);
49
+ QEMU_BUILD_BUG_ON(VIRTIO_BLK_CFG_SIZE > sizeof(blkcfg));
50
}
51
52
static void virtio_blk_set_config(VirtIODevice *vdev, const uint8_t *config)
53
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_set_config(VirtIODevice *vdev, const uint8_t *config)
54
VirtIOBlock *s = VIRTIO_BLK(vdev);
55
struct virtio_blk_config blkcfg;
56
57
- memcpy(&blkcfg, config, sizeof(blkcfg));
58
+ memcpy(&blkcfg, config, VIRTIO_BLK_CFG_SIZE);
59
+ QEMU_BUILD_BUG_ON(VIRTIO_BLK_CFG_SIZE > sizeof(blkcfg));
60
61
aio_context_acquire(blk_get_aio_context(s->blk));
62
blk_set_enable_write_cache(s->blk, blkcfg.wce != 0);
63
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)
64
return;
65
}
66
67
- virtio_init(vdev, "virtio-blk", VIRTIO_ID_BLOCK,
68
- sizeof(struct virtio_blk_config));
69
+ virtio_init(vdev, "virtio-blk", VIRTIO_ID_BLOCK, VIRTIO_BLK_CFG_SIZE);
70
71
s->blk = conf->conf.blk;
72
s->rq = NULL;
73
--
24
--
74
2.20.1
25
2.31.1
75
26
76
diff view generated by jsdifflib