1 | The following changes since commit 063833a6ec2a6747e27c5f9866bb44c7e8de1265: | 1 | The following changes since commit 768cef2974fb1fa30dd188b043ea737e13fea477: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into staging (2017-10-19 18:42:51 +0100) | 3 | Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging (2018-07-24 10:37:52 +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 | git://github.com/stefanha/qemu.git tags/block-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to e947d47da0b16e80d237c510e9d2e80799578c7f: | 9 | for you to fetch changes up to 042b757cc77c9580b99ef2781cfb0a2d1bf495a6: |
10 | 10 | ||
11 | oslib-posix: Fix compiler warning and some data types (2017-10-20 11:16:27 +0200) | 11 | block/file-posix: add bdrv_attach_aio_context callback for host dev and cdrom (2018-07-24 14:27:41 +0100) |
12 | |||
13 | ---------------------------------------------------------------- | ||
14 | Pull request | ||
15 | |||
16 | Regression fix for host block devices with the file-posix driver when aio=native is in use. | ||
12 | 17 | ||
13 | ---------------------------------------------------------------- | 18 | ---------------------------------------------------------------- |
14 | 19 | ||
15 | ---------------------------------------------------------------- | 20 | Nishanth Aravamudan (1): |
21 | block/file-posix: add bdrv_attach_aio_context callback for host dev | ||
22 | and cdrom | ||
16 | 23 | ||
17 | Stefan Weil (1): | 24 | block/file-posix.c | 3 +++ |
18 | oslib-posix: Fix compiler warning and some data types | 25 | 1 file changed, 3 insertions(+) |
19 | |||
20 | util/oslib-posix.c | 15 ++++++++------- | ||
21 | 1 file changed, 8 insertions(+), 7 deletions(-) | ||
22 | 26 | ||
23 | -- | 27 | -- |
24 | 2.13.6 | 28 | 2.17.1 |
25 | 29 | ||
26 | 30 | diff view generated by jsdifflib |
1 | From: Stefan Weil <sw@weilnetz.de> | 1 | From: Nishanth Aravamudan <naravamudan@digitalocean.com> |
---|---|---|---|
2 | 2 | ||
3 | gcc warning: | 3 | In ed6e2161 ("linux-aio: properly bubble up errors from initialzation"), |
4 | I only added a bdrv_attach_aio_context callback for the bdrv_file | ||
5 | driver. There are several other drivers that use the shared | ||
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. | ||
4 | 10 | ||
5 | /qemu/util/oslib-posix.c:304:11: error: | 11 | Fixes: ed6e2161 ("linux-aio: properly bubble up errors from initialization") |
6 | variable ‘addr’ might be clobbered by ‘longjmp’ or ‘vfork’ | 12 | Reported-by: Farhan Ali <alifm@linux.ibm.com> |
7 | [-Werror=clobbered] | 13 | Signed-off-by: Nishanth Aravamudan <naravamudan@digitalocean.com> |
8 | 14 | Reviewed-by: John Snow <jsnow@redhat.com> | |
9 | Fix also some related data types: | 15 | Message-id: 20180718211256.29774-1-naravamudan@digitalocean.com |
10 | 16 | Cc: Eric Blake <eblake@redhat.com> | |
11 | numpages, hpagesize are used as pointer offset. | 17 | Cc: Kevin Wolf <kwolf@redhat.com> |
12 | Always use size_t for them and also for the derived | 18 | Cc: John Snow <jsnow@redhat.com> |
13 | numpages_per_thread and size_per_thread. | 19 | Cc: Max Reitz <mreitz@redhat.com> |
14 | 20 | Cc: Stefan Hajnoczi <stefanha@redhat.com> | |
15 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 21 | Cc: Fam Zheng <famz@redhat.com> |
16 | Signed-off-by: Stefan Weil <sw@weilnetz.de> | 22 | Cc: Paolo Bonzini <pbonzini@redhat.com> |
17 | Message-id: 20171016202912.1117-1-sw@weilnetz.de | 23 | Cc: qemu-block@nongnu.org |
24 | Cc: qemu-devel@nongnu.org | ||
18 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 25 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
19 | --- | 26 | --- |
20 | util/oslib-posix.c | 15 ++++++++------- | 27 | block/file-posix.c | 3 +++ |
21 | 1 file changed, 8 insertions(+), 7 deletions(-) | 28 | 1 file changed, 3 insertions(+) |
22 | 29 | ||
23 | diff --git a/util/oslib-posix.c b/util/oslib-posix.c | 30 | diff --git a/block/file-posix.c b/block/file-posix.c |
24 | index XXXXXXX..XXXXXXX 100644 | 31 | index XXXXXXX..XXXXXXX 100644 |
25 | --- a/util/oslib-posix.c | 32 | --- a/block/file-posix.c |
26 | +++ b/util/oslib-posix.c | 33 | +++ b/block/file-posix.c |
27 | @@ -XXX,XX +XXX,XX @@ | 34 | @@ -XXX,XX +XXX,XX @@ static BlockDriver bdrv_host_device = { |
28 | 35 | .bdrv_refresh_limits = raw_refresh_limits, | |
29 | struct MemsetThread { | 36 | .bdrv_io_plug = raw_aio_plug, |
30 | char *addr; | 37 | .bdrv_io_unplug = raw_aio_unplug, |
31 | - uint64_t numpages; | 38 | + .bdrv_attach_aio_context = raw_aio_attach_aio_context, |
32 | - uint64_t hpagesize; | 39 | |
33 | + size_t numpages; | 40 | .bdrv_co_truncate = raw_co_truncate, |
34 | + size_t hpagesize; | 41 | .bdrv_getlength = raw_getlength, |
35 | QemuThread pgthread; | 42 | @@ -XXX,XX +XXX,XX @@ static BlockDriver bdrv_host_cdrom = { |
36 | sigjmp_buf env; | 43 | .bdrv_refresh_limits = raw_refresh_limits, |
37 | }; | 44 | .bdrv_io_plug = raw_aio_plug, |
38 | @@ -XXX,XX +XXX,XX @@ static void sigbus_handler(int signal) | 45 | .bdrv_io_unplug = raw_aio_unplug, |
39 | static void *do_touch_pages(void *arg) | 46 | + .bdrv_attach_aio_context = raw_aio_attach_aio_context, |
40 | { | 47 | |
41 | MemsetThread *memset_args = (MemsetThread *)arg; | 48 | .bdrv_co_truncate = raw_co_truncate, |
42 | - char *addr = memset_args->addr; | 49 | .bdrv_getlength = raw_getlength, |
43 | - uint64_t numpages = memset_args->numpages; | 50 | @@ -XXX,XX +XXX,XX @@ static BlockDriver bdrv_host_cdrom = { |
44 | - uint64_t hpagesize = memset_args->hpagesize; | 51 | .bdrv_refresh_limits = raw_refresh_limits, |
45 | sigset_t set, oldset; | 52 | .bdrv_io_plug = raw_aio_plug, |
46 | - int i = 0; | 53 | .bdrv_io_unplug = raw_aio_unplug, |
47 | 54 | + .bdrv_attach_aio_context = raw_aio_attach_aio_context, | |
48 | /* unblock SIGBUS */ | 55 | |
49 | sigemptyset(&set); | 56 | .bdrv_co_truncate = raw_co_truncate, |
50 | @@ -XXX,XX +XXX,XX @@ static void *do_touch_pages(void *arg) | 57 | .bdrv_getlength = raw_getlength, |
51 | if (sigsetjmp(memset_args->env, 1)) { | ||
52 | memset_thread_failed = true; | ||
53 | } else { | ||
54 | + char *addr = memset_args->addr; | ||
55 | + size_t numpages = memset_args->numpages; | ||
56 | + size_t hpagesize = memset_args->hpagesize; | ||
57 | + size_t i; | ||
58 | for (i = 0; i < numpages; i++) { | ||
59 | /* | ||
60 | * Read & write back the same value, so we don't | ||
61 | @@ -XXX,XX +XXX,XX @@ static inline int get_memset_num_threads(int smp_cpus) | ||
62 | static bool touch_all_pages(char *area, size_t hpagesize, size_t numpages, | ||
63 | int smp_cpus) | ||
64 | { | ||
65 | - uint64_t numpages_per_thread, size_per_thread; | ||
66 | + size_t numpages_per_thread; | ||
67 | + size_t size_per_thread; | ||
68 | char *addr = area; | ||
69 | int i = 0; | ||
70 | |||
71 | -- | 58 | -- |
72 | 2.13.6 | 59 | 2.17.1 |
73 | 60 | ||
74 | 61 | diff view generated by jsdifflib |