1
The following changes since commit 64175afc695c0672876fbbfc31b299c86d562cb4:
1
The following changes since commit 41feb5b955f0d7c9d071b2c5adbc404ae2895c7a:
2
2
3
arm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented (2017-06-07 17:21:44 +0100)
3
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-3.0-pull-request' into staging (2018-06-05 10:38:33 +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/codyprime/qemu-kvm-jtc.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 56faeb9bb6872b3f926b3b3e0452a70beea10af2:
9
for you to fetch changes up to 68acc99f143b60ec4faa2903065b187d4d3c4bf3:
10
10
11
block/gluster.c: Handle qdict_array_entries() failure (2017-06-09 08:41:29 -0400)
11
sheepdog: remove huge BSS object (2018-06-05 10:15:12 -0400)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Gluster patch
14
Sheepdog patches
15
----------------------------------------------------------------
15
----------------------------------------------------------------
16
16
17
Peter Maydell (1):
17
Paolo Bonzini (2):
18
block/gluster.c: Handle qdict_array_entries() failure
18
sheepdog: cleanup repeated expression
19
sheepdog: remove huge BSS object
19
20
20
block/gluster.c | 3 +--
21
block/sheepdog.c | 28 +++++++++++++++-------------
21
1 file changed, 1 insertion(+), 2 deletions(-)
22
1 file changed, 15 insertions(+), 13 deletions(-)
22
23
23
--
24
--
24
2.9.3
25
2.13.6
25
26
26
27
diff view generated by jsdifflib
New patch
1
From: Paolo Bonzini <pbonzini@redhat.com>
1
2
3
The expression "SD_INODE_SIZE - sizeof(inode.data_vdi_id)" already has a macro
4
defined for the same value (though with a nicer definition using offsetof).
5
Replace it.
6
7
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Reviewed-by: Fam Zheng <famz@redhat.com>
9
Reviewed-by: Jeff Cody <jcody@redhat.com>
10
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11
Message-Id: <20180523160721.14018-2-pbonzini@redhat.com>
12
Signed-off-by: Jeff Cody <jcody@redhat.com>
13
---
14
block/sheepdog.c | 6 +++---
15
1 file changed, 3 insertions(+), 3 deletions(-)
16
17
diff --git a/block/sheepdog.c b/block/sheepdog.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/block/sheepdog.c
20
+++ b/block/sheepdog.c
21
@@ -XXX,XX +XXX,XX @@ static int sd_truncate(BlockDriverState *bs, int64_t offset,
22
}
23
24
/* we don't need to update entire object */
25
- datalen = SD_INODE_SIZE - sizeof(s->inode.data_vdi_id);
26
+ datalen = SD_INODE_HEADER_SIZE;
27
s->inode.vdi_size = offset;
28
ret = write_object(fd, s->bs, (char *)&s->inode,
29
vid_to_vdi_oid(s->inode.vdi_id), s->inode.nr_copies,
30
@@ -XXX,XX +XXX,XX @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
31
*/
32
strncpy(s->inode.tag, sn_info->name, sizeof(s->inode.tag));
33
/* we don't need to update entire object */
34
- datalen = SD_INODE_SIZE - sizeof(s->inode.data_vdi_id);
35
+ datalen = SD_INODE_HEADER_SIZE;
36
inode = g_malloc(datalen);
37
38
/* refresh inode. */
39
@@ -XXX,XX +XXX,XX @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab)
40
/* we don't need to read entire object */
41
ret = read_object(fd, s->bs, (char *)&inode,
42
vid_to_vdi_oid(vid),
43
- 0, SD_INODE_SIZE - sizeof(inode.data_vdi_id), 0,
44
+ 0, SD_INODE_HEADER_SIZE, 0,
45
s->cache_flags);
46
47
if (ret) {
48
--
49
2.13.6
50
51
diff view generated by jsdifflib
1
From: Peter Maydell <peter.maydell@linaro.org>
1
From: Paolo Bonzini <pbonzini@redhat.com>
2
2
3
In qemu_gluster_parse_json(), the call to qdict_array_entries()
3
block/sheepdog.o has a 4M static variable that is 90% of QEMU's whole .bss
4
could return a negative error code, which we were ignoring
4
section. Replace it with a heap-allocated block, and make it smaller too
5
because we assigned the result to an unsigned variable.
5
since only the inode header is actually being used.
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'.
9
6
10
(Spotted by Coverity, CID 1360960.)
7
bss size goes down from 4464280 to 269976.
11
8
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
13
Reviewed-by: Eric Blake <eblake@redhat.com>
14
Reviewed-by: Jeff Cody <jcody@redhat.com>
10
Reviewed-by: Jeff Cody <jcody@redhat.com>
15
Message-id: 1496682098-1540-1-git-send-email-peter.maydell@linaro.org
11
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12
Message-Id: <20180523160721.14018-3-pbonzini@redhat.com>
16
Signed-off-by: Jeff Cody <jcody@redhat.com>
13
Signed-off-by: Jeff Cody <jcody@redhat.com>
17
---
14
---
18
block/gluster.c | 3 +--
15
block/sheepdog.c | 22 ++++++++++++----------
19
1 file changed, 1 insertion(+), 2 deletions(-)
16
1 file changed, 12 insertions(+), 10 deletions(-)
20
17
21
diff --git a/block/gluster.c b/block/gluster.c
18
diff --git a/block/sheepdog.c b/block/sheepdog.c
22
index XXXXXXX..XXXXXXX 100644
19
index XXXXXXX..XXXXXXX 100644
23
--- a/block/gluster.c
20
--- a/block/sheepdog.c
24
+++ b/block/gluster.c
21
+++ b/block/sheepdog.c
25
@@ -XXX,XX +XXX,XX @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
22
@@ -XXX,XX +XXX,XX @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab)
26
Error *local_err = NULL;
23
QEMUSnapshotInfo *sn_tab = NULL;
27
char *str = NULL;
24
unsigned wlen, rlen;
28
const char *ptr;
25
int found = 0;
29
- size_t num_servers;
26
- static SheepdogInode inode;
30
- int i, type;
27
+ SheepdogInode *inode;
31
+ int i, type, num_servers;
28
unsigned long *vdi_inuse;
32
29
unsigned int start_nr;
33
/* create opts info from runtime_json_opts list */
30
uint64_t hval;
34
opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort);
31
uint32_t vid;
32
33
vdi_inuse = g_malloc(max);
34
+ inode = g_malloc(SD_INODE_HEADER_SIZE);
35
36
fd = connect_to_sdog(s, &local_err);
37
if (fd < 0) {
38
@@ -XXX,XX +XXX,XX @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab)
39
}
40
41
/* we don't need to read entire object */
42
- ret = read_object(fd, s->bs, (char *)&inode,
43
+ ret = read_object(fd, s->bs, (char *)inode,
44
vid_to_vdi_oid(vid),
45
0, SD_INODE_HEADER_SIZE, 0,
46
s->cache_flags);
47
@@ -XXX,XX +XXX,XX @@ static int sd_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab)
48
continue;
49
}
50
51
- if (!strcmp(inode.name, s->name) && is_snapshot(&inode)) {
52
- sn_tab[found].date_sec = inode.snap_ctime >> 32;
53
- sn_tab[found].date_nsec = inode.snap_ctime & 0xffffffff;
54
- sn_tab[found].vm_state_size = inode.vm_state_size;
55
- sn_tab[found].vm_clock_nsec = inode.vm_clock_nsec;
56
+ if (!strcmp(inode->name, s->name) && is_snapshot(inode)) {
57
+ sn_tab[found].date_sec = inode->snap_ctime >> 32;
58
+ sn_tab[found].date_nsec = inode->snap_ctime & 0xffffffff;
59
+ sn_tab[found].vm_state_size = inode->vm_state_size;
60
+ sn_tab[found].vm_clock_nsec = inode->vm_clock_nsec;
61
62
snprintf(sn_tab[found].id_str, sizeof(sn_tab[found].id_str),
63
- "%" PRIu32, inode.snap_id);
64
+ "%" PRIu32, inode->snap_id);
65
pstrcpy(sn_tab[found].name,
66
- MIN(sizeof(sn_tab[found].name), sizeof(inode.tag)),
67
- inode.tag);
68
+ MIN(sizeof(sn_tab[found].name), sizeof(inode->tag)),
69
+ inode->tag);
70
found++;
71
}
72
}
73
@@ -XXX,XX +XXX,XX @@ out:
74
*psn_tab = sn_tab;
75
76
g_free(vdi_inuse);
77
+ g_free(inode);
78
79
if (ret < 0) {
80
return ret;
35
--
81
--
36
2.9.3
82
2.13.6
37
83
38
84
diff view generated by jsdifflib