1 | The following changes since commit 768cef2974fb1fa30dd188b043ea737e13fea477: | 1 | The following changes since commit ca61fa4b803e5d0abaf6f1ceb690f23bb78a4def: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging (2018-07-24 10:37:52 +0100) | 3 | Merge remote-tracking branch 'remotes/quic/tags/pull-hex-20211006' into staging (2021-10-06 12:11:14 -0700) |
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 042b757cc77c9580b99ef2781cfb0a2d1bf495a6: | 9 | for you to fetch changes up to 1cc7eada97914f090125e588497986f6f7900514: |
10 | 10 | ||
11 | block/file-posix: add bdrv_attach_aio_context callback for host dev and cdrom (2018-07-24 14:27:41 +0100) | 11 | iothread: use IOThreadParamInfo in iothread_[set|get]_param() (2021-10-07 15:29:50 +0100) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Pull request | 14 | Pull request |
15 | 15 | ||
16 | Regression fix for host block devices with the file-posix driver when aio=native is in use. | ||
17 | |||
18 | ---------------------------------------------------------------- | 16 | ---------------------------------------------------------------- |
19 | 17 | ||
20 | Nishanth Aravamudan (1): | 18 | Stefano Garzarella (2): |
21 | block/file-posix: add bdrv_attach_aio_context callback for host dev | 19 | iothread: rename PollParamInfo to IOThreadParamInfo |
22 | and cdrom | 20 | iothread: use IOThreadParamInfo in iothread_[set|get]_param() |
23 | 21 | ||
24 | block/file-posix.c | 3 +++ | 22 | iothread.c | 28 +++++++++++++++------------- |
25 | 1 file changed, 3 insertions(+) | 23 | 1 file changed, 15 insertions(+), 13 deletions(-) |
26 | 24 | ||
27 | -- | 25 | -- |
28 | 2.17.1 | 26 | 2.31.1 |
29 | 27 | ||
30 | 28 | ||
29 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Stefano Garzarella <sgarzare@redhat.com> | ||
1 | 2 | ||
3 | Commit 1793ad0247 ("iothread: add aio-max-batch parameter") added | ||
4 | a new parameter (aio-max-batch) to IOThread and used PollParamInfo | ||
5 | structure to handle it. | ||
6 | |||
7 | Since it is not a parameter of the polling mechanism, we rename the | ||
8 | structure to a more generic IOThreadParamInfo. | ||
9 | |||
10 | Suggested-by: Kevin Wolf <kwolf@redhat.com> | ||
11 | Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> | ||
12 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
13 | Message-id: 20210727145936.147032-2-sgarzare@redhat.com | ||
14 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
15 | --- | ||
16 | iothread.c | 14 +++++++------- | ||
17 | 1 file changed, 7 insertions(+), 7 deletions(-) | ||
18 | |||
19 | diff --git a/iothread.c b/iothread.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/iothread.c | ||
22 | +++ b/iothread.c | ||
23 | @@ -XXX,XX +XXX,XX @@ static void iothread_complete(UserCreatable *obj, Error **errp) | ||
24 | typedef struct { | ||
25 | const char *name; | ||
26 | ptrdiff_t offset; /* field's byte offset in IOThread struct */ | ||
27 | -} PollParamInfo; | ||
28 | +} IOThreadParamInfo; | ||
29 | |||
30 | -static PollParamInfo poll_max_ns_info = { | ||
31 | +static IOThreadParamInfo poll_max_ns_info = { | ||
32 | "poll-max-ns", offsetof(IOThread, poll_max_ns), | ||
33 | }; | ||
34 | -static PollParamInfo poll_grow_info = { | ||
35 | +static IOThreadParamInfo poll_grow_info = { | ||
36 | "poll-grow", offsetof(IOThread, poll_grow), | ||
37 | }; | ||
38 | -static PollParamInfo poll_shrink_info = { | ||
39 | +static IOThreadParamInfo poll_shrink_info = { | ||
40 | "poll-shrink", offsetof(IOThread, poll_shrink), | ||
41 | }; | ||
42 | -static PollParamInfo aio_max_batch_info = { | ||
43 | +static IOThreadParamInfo aio_max_batch_info = { | ||
44 | "aio-max-batch", offsetof(IOThread, aio_max_batch), | ||
45 | }; | ||
46 | |||
47 | @@ -XXX,XX +XXX,XX @@ static void iothread_get_param(Object *obj, Visitor *v, | ||
48 | const char *name, void *opaque, Error **errp) | ||
49 | { | ||
50 | IOThread *iothread = IOTHREAD(obj); | ||
51 | - PollParamInfo *info = opaque; | ||
52 | + IOThreadParamInfo *info = opaque; | ||
53 | int64_t *field = (void *)iothread + info->offset; | ||
54 | |||
55 | visit_type_int64(v, name, field, errp); | ||
56 | @@ -XXX,XX +XXX,XX @@ static bool iothread_set_param(Object *obj, Visitor *v, | ||
57 | const char *name, void *opaque, Error **errp) | ||
58 | { | ||
59 | IOThread *iothread = IOTHREAD(obj); | ||
60 | - PollParamInfo *info = opaque; | ||
61 | + IOThreadParamInfo *info = opaque; | ||
62 | int64_t *field = (void *)iothread + info->offset; | ||
63 | int64_t value; | ||
64 | |||
65 | -- | ||
66 | 2.31.1 | ||
67 | |||
68 | diff view generated by jsdifflib |
1 | From: Nishanth Aravamudan <naravamudan@digitalocean.com> | 1 | From: Stefano Garzarella <sgarzare@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | In ed6e2161 ("linux-aio: properly bubble up errors from initialzation"), | 3 | Commit 0445409d74 ("iothread: generalize |
4 | I only added a bdrv_attach_aio_context callback for the bdrv_file | 4 | iothread_set_param/iothread_get_param") moved common code to set and |
5 | driver. There are several other drivers that use the shared | 5 | get IOThread parameters in two new functions. |
6 | aio_plug callback, though, and they will trip the assertion added to | ||
7 | aio_get_linux_aio because they did not call aio_setup_linux_aio first. | ||
8 | Add the appropriate callback definition to the affected driver | ||
9 | definitions. | ||
10 | 6 | ||
11 | Fixes: ed6e2161 ("linux-aio: properly bubble up errors from initialization") | 7 | These functions are called inside callbacks, so we don't need to use an |
12 | Reported-by: Farhan Ali <alifm@linux.ibm.com> | 8 | opaque pointer. Let's replace `void *opaque` parameter with |
13 | Signed-off-by: Nishanth Aravamudan <naravamudan@digitalocean.com> | 9 | `IOThreadParamInfo *info`. |
14 | Reviewed-by: John Snow <jsnow@redhat.com> | 10 | |
15 | Message-id: 20180718211256.29774-1-naravamudan@digitalocean.com | 11 | Suggested-by: Kevin Wolf <kwolf@redhat.com> |
16 | Cc: Eric Blake <eblake@redhat.com> | 12 | Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> |
17 | Cc: Kevin Wolf <kwolf@redhat.com> | 13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
18 | Cc: John Snow <jsnow@redhat.com> | 14 | Message-id: 20210727145936.147032-3-sgarzare@redhat.com |
19 | Cc: Max Reitz <mreitz@redhat.com> | ||
20 | Cc: Stefan Hajnoczi <stefanha@redhat.com> | ||
21 | Cc: Fam Zheng <famz@redhat.com> | ||
22 | Cc: Paolo Bonzini <pbonzini@redhat.com> | ||
23 | Cc: qemu-block@nongnu.org | ||
24 | Cc: qemu-devel@nongnu.org | ||
25 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 15 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
26 | --- | 16 | --- |
27 | block/file-posix.c | 3 +++ | 17 | iothread.c | 18 ++++++++++-------- |
28 | 1 file changed, 3 insertions(+) | 18 | 1 file changed, 10 insertions(+), 8 deletions(-) |
29 | 19 | ||
30 | diff --git a/block/file-posix.c b/block/file-posix.c | 20 | diff --git a/iothread.c b/iothread.c |
31 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
32 | --- a/block/file-posix.c | 22 | --- a/iothread.c |
33 | +++ b/block/file-posix.c | 23 | +++ b/iothread.c |
34 | @@ -XXX,XX +XXX,XX @@ static BlockDriver bdrv_host_device = { | 24 | @@ -XXX,XX +XXX,XX @@ static IOThreadParamInfo aio_max_batch_info = { |
35 | .bdrv_refresh_limits = raw_refresh_limits, | 25 | }; |
36 | .bdrv_io_plug = raw_aio_plug, | 26 | |
37 | .bdrv_io_unplug = raw_aio_unplug, | 27 | static void iothread_get_param(Object *obj, Visitor *v, |
38 | + .bdrv_attach_aio_context = raw_aio_attach_aio_context, | 28 | - const char *name, void *opaque, Error **errp) |
39 | 29 | + const char *name, IOThreadParamInfo *info, Error **errp) | |
40 | .bdrv_co_truncate = raw_co_truncate, | 30 | { |
41 | .bdrv_getlength = raw_getlength, | 31 | IOThread *iothread = IOTHREAD(obj); |
42 | @@ -XXX,XX +XXX,XX @@ static BlockDriver bdrv_host_cdrom = { | 32 | - IOThreadParamInfo *info = opaque; |
43 | .bdrv_refresh_limits = raw_refresh_limits, | 33 | int64_t *field = (void *)iothread + info->offset; |
44 | .bdrv_io_plug = raw_aio_plug, | 34 | |
45 | .bdrv_io_unplug = raw_aio_unplug, | 35 | visit_type_int64(v, name, field, errp); |
46 | + .bdrv_attach_aio_context = raw_aio_attach_aio_context, | 36 | } |
47 | 37 | ||
48 | .bdrv_co_truncate = raw_co_truncate, | 38 | static bool iothread_set_param(Object *obj, Visitor *v, |
49 | .bdrv_getlength = raw_getlength, | 39 | - const char *name, void *opaque, Error **errp) |
50 | @@ -XXX,XX +XXX,XX @@ static BlockDriver bdrv_host_cdrom = { | 40 | + const char *name, IOThreadParamInfo *info, Error **errp) |
51 | .bdrv_refresh_limits = raw_refresh_limits, | 41 | { |
52 | .bdrv_io_plug = raw_aio_plug, | 42 | IOThread *iothread = IOTHREAD(obj); |
53 | .bdrv_io_unplug = raw_aio_unplug, | 43 | - IOThreadParamInfo *info = opaque; |
54 | + .bdrv_attach_aio_context = raw_aio_attach_aio_context, | 44 | int64_t *field = (void *)iothread + info->offset; |
55 | 45 | int64_t value; | |
56 | .bdrv_co_truncate = raw_co_truncate, | 46 | |
57 | .bdrv_getlength = raw_getlength, | 47 | @@ -XXX,XX +XXX,XX @@ static bool iothread_set_param(Object *obj, Visitor *v, |
48 | static void iothread_get_poll_param(Object *obj, Visitor *v, | ||
49 | const char *name, void *opaque, Error **errp) | ||
50 | { | ||
51 | + IOThreadParamInfo *info = opaque; | ||
52 | |||
53 | - iothread_get_param(obj, v, name, opaque, errp); | ||
54 | + iothread_get_param(obj, v, name, info, errp); | ||
55 | } | ||
56 | |||
57 | static void iothread_set_poll_param(Object *obj, Visitor *v, | ||
58 | const char *name, void *opaque, Error **errp) | ||
59 | { | ||
60 | IOThread *iothread = IOTHREAD(obj); | ||
61 | + IOThreadParamInfo *info = opaque; | ||
62 | |||
63 | - if (!iothread_set_param(obj, v, name, opaque, errp)) { | ||
64 | + if (!iothread_set_param(obj, v, name, info, errp)) { | ||
65 | return; | ||
66 | } | ||
67 | |||
68 | @@ -XXX,XX +XXX,XX @@ static void iothread_set_poll_param(Object *obj, Visitor *v, | ||
69 | static void iothread_get_aio_param(Object *obj, Visitor *v, | ||
70 | const char *name, void *opaque, Error **errp) | ||
71 | { | ||
72 | + IOThreadParamInfo *info = opaque; | ||
73 | |||
74 | - iothread_get_param(obj, v, name, opaque, errp); | ||
75 | + iothread_get_param(obj, v, name, info, errp); | ||
76 | } | ||
77 | |||
78 | static void iothread_set_aio_param(Object *obj, Visitor *v, | ||
79 | const char *name, void *opaque, Error **errp) | ||
80 | { | ||
81 | IOThread *iothread = IOTHREAD(obj); | ||
82 | + IOThreadParamInfo *info = opaque; | ||
83 | |||
84 | - if (!iothread_set_param(obj, v, name, opaque, errp)) { | ||
85 | + if (!iothread_set_param(obj, v, name, info, errp)) { | ||
86 | return; | ||
87 | } | ||
88 | |||
58 | -- | 89 | -- |
59 | 2.17.1 | 90 | 2.31.1 |
60 | 91 | ||
61 | 92 | diff view generated by jsdifflib |