1 | The following changes since commit d84f714eafedd8bb9d4aaec8b76417bef8e3535e: | 1 | The following changes since commit 64175afc695c0672876fbbfc31b299c86d562cb4: |
---|---|---|---|
2 | 2 | ||
3 | Update version for v2.9.0-rc0 release (2017-03-14 19:18:23 +0000) | 3 | arm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented (2017-06-07 17:21:44 +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/codyprime/qemu-kvm-jtc.git tags/block-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to 9dc44aa5829eb3131a01378a738dee28a382bbc1: | 9 | for you to fetch changes up to 56faeb9bb6872b3f926b3b3e0452a70beea10af2: |
10 | 10 | ||
11 | os: don't corrupt pre-existing memory-backend data with prealloc (2017-03-15 11:55:41 +0800) | 11 | block/gluster.c: Handle qdict_array_entries() failure (2017-06-09 08:41:29 -0400) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | 14 | Gluster patch | |
15 | ---------------------------------------------------------------- | 15 | ---------------------------------------------------------------- |
16 | 16 | ||
17 | Daniel P. Berrange (1): | 17 | Peter Maydell (1): |
18 | os: don't corrupt pre-existing memory-backend data with prealloc | 18 | block/gluster.c: Handle qdict_array_entries() failure |
19 | 19 | ||
20 | util/oslib-posix.c | 14 +++++++++++++- | 20 | block/gluster.c | 3 +-- |
21 | 1 file changed, 13 insertions(+), 1 deletion(-) | 21 | 1 file changed, 1 insertion(+), 2 deletions(-) |
22 | 22 | ||
23 | -- | 23 | -- |
24 | 2.9.3 | 24 | 2.9.3 |
25 | 25 | ||
26 | 26 | diff view generated by jsdifflib |
1 | From: "Daniel P. Berrange" <berrange@redhat.com> | 1 | From: Peter Maydell <peter.maydell@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | When using a memory-backend object with prealloc turned on, QEMU | 3 | In qemu_gluster_parse_json(), the call to qdict_array_entries() |
4 | will memset() the first byte in every memory page to zero. While | 4 | could return a negative error code, which we were ignoring |
5 | this might have been acceptable for memory backends associated | 5 | because we assigned the result to an unsigned variable. |
6 | with RAM, this corrupts application data for NVDIMMs. | 6 | Fix this by using the 'int' type instead, which matches the |
7 | return type of qdict_array_entries() and also the type | ||
8 | we use for the loop enumeration variable 'i'. | ||
7 | 9 | ||
8 | Instead of setting every page to zero, read the current byte | 10 | (Spotted by Coverity, CID 1360960.) |
9 | value and then just write that same value back, so we are not | ||
10 | corrupting the original data. Directly write the value instead | ||
11 | of memset()ing it, since there's no benefit to memset for a | ||
12 | single byte write. | ||
13 | 11 | ||
14 | Signed-off-by: Daniel P. Berrange <berrange@redhat.com> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
15 | Reviewed-by: Andrea Arcangeli <aarcange@redhat.com> | 13 | Reviewed-by: Eric Blake <eblake@redhat.com> |
16 | Message-id: 20170303113255.28262-1-berrange@redhat.com | 14 | Reviewed-by: Jeff Cody <jcody@redhat.com> |
17 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 15 | Message-id: 1496682098-1540-1-git-send-email-peter.maydell@linaro.org |
16 | Signed-off-by: Jeff Cody <jcody@redhat.com> | ||
18 | --- | 17 | --- |
19 | util/oslib-posix.c | 14 +++++++++++++- | 18 | block/gluster.c | 3 +-- |
20 | 1 file changed, 13 insertions(+), 1 deletion(-) | 19 | 1 file changed, 1 insertion(+), 2 deletions(-) |
21 | 20 | ||
22 | diff --git a/util/oslib-posix.c b/util/oslib-posix.c | 21 | diff --git a/block/gluster.c b/block/gluster.c |
23 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
24 | --- a/util/oslib-posix.c | 23 | --- a/block/gluster.c |
25 | +++ b/util/oslib-posix.c | 24 | +++ b/block/gluster.c |
26 | @@ -XXX,XX +XXX,XX @@ static void *do_touch_pages(void *arg) | 25 | @@ -XXX,XX +XXX,XX @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf, |
27 | memset_thread_failed = true; | 26 | Error *local_err = NULL; |
28 | } else { | 27 | char *str = NULL; |
29 | for (i = 0; i < numpages; i++) { | 28 | const char *ptr; |
30 | - memset(addr, 0, 1); | 29 | - size_t num_servers; |
31 | + /* | 30 | - int i, type; |
32 | + * Read & write back the same value, so we don't | 31 | + int i, type, num_servers; |
33 | + * corrupt existing user/app data that might be | 32 | |
34 | + * stored. | 33 | /* create opts info from runtime_json_opts list */ |
35 | + * | 34 | opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort); |
36 | + * 'volatile' to stop compiler optimizing this away | ||
37 | + * to a no-op | ||
38 | + * | ||
39 | + * TODO: get a better solution from kernel so we | ||
40 | + * don't need to write at all so we don't cause | ||
41 | + * wear on the storage backing the region... | ||
42 | + */ | ||
43 | + *(volatile char *)addr = *addr; | ||
44 | addr += hpagesize; | ||
45 | } | ||
46 | } | ||
47 | -- | 35 | -- |
48 | 2.9.3 | 36 | 2.9.3 |
49 | 37 | ||
50 | 38 | diff view generated by jsdifflib |