1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257 | commit 88628103aabb15789848f423d48d5efa602d27d0 (tag: pkg/import/1%2.3+dfsg-5ubuntu6)
Author: Ryan Harper <ryan.harper@canonical.com>
Date: Tue Sep 15 09:37:23 2015 -0500
Import version 1:2.3+dfsg-5ubuntu6 to ubuntu/wily-proposed
Imported using usd-importer.
diff --git a/debian/changelog b/debian/changelog
index 841fe05885..fcc9f35d35 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+qemu (1:2.3+dfsg-5ubuntu6) wily; urgency=medium
+
+ * Make qemu-system-common and qemu-utils depend on qemu-block-extra
+ to fix errors with missing block backends. (LP: #1495895)
+ * Cherry pick fixes for vmdk stream-optimized subformat (LP: #1006655)
+ * Apply fix for memory corruption during live-migration in tcg mode
+ (LP: #1493049)
+ * Apply tracing patch to remove use of custom vtable in newer glibc
+ (LP: #1491972)
+
+ -- Ryan Harper <ryan.harper@canonical.com> Tue, 15 Sep 2015 09:37:23 -0500
+
qemu (1:2.3+dfsg-5ubuntu5) wily; urgency=medium
* Import qcow2-handle-eagain-from-update_refcount from upstream
diff --git a/debian/control b/debian/control
index a3ec65cce4..da3c0e95d9 100644
--- a/debian/control
+++ b/debian/control
@@ -180,6 +180,7 @@ Multi-Arch: foreign
Pre-Depends: adduser
Provides: qemu-keymaps
Depends: ${misc:Depends}, ${shlibs:Depends},
+ qemu-block-extra (= ${binary:Version}),
# to fix wrong acl for newly created device node on ubuntu:
acl
Breaks:
@@ -468,9 +469,10 @@ Description: QEMU user mode binfmt registration for qemu-user
Package: qemu-utils
Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
Multi-Arch: foreign
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ qemu-block-extra (= ${binary:Version}),
Recommends: sharutils
-Suggests: debootstrap, qemu-block-extra (= ${binary:Version}),
+Suggests: debootstrap,
Conflicts: qemu-user (<< 0.11.1-2), qemu-kvm (<< 1.2.0.dfsg-1)
Replaces: qemu-user (<< 0.11.1-2), qemu-kvm (<< 1.2.0.dfsg-1)
Description: QEMU utilities
diff --git a/debian/control-in b/debian/control-in
index 1ccdd260c6..e58655c063 100644
--- a/debian/control-in
+++ b/debian/control-in
@@ -189,6 +189,7 @@ Multi-Arch: foreign
Pre-Depends: adduser
Provides: qemu-keymaps
Depends: ${misc:Depends}, ${shlibs:Depends},
+:ubuntu: qemu-block-extra (= ${binary:Version}),
# to fix wrong acl for newly created device node on ubuntu:
:ubuntu: acl
Breaks:
@@ -479,9 +480,11 @@ Description: QEMU user mode binfmt registration for qemu-user
Package: qemu-utils
Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
Multi-Arch: foreign
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends},
+:ubuntu: qemu-block-extra (= ${binary:Version}),
Recommends: sharutils
-Suggests: debootstrap, qemu-block-extra (= ${binary:Version}),
+Suggests: debootstrap,
+:debian: qemu-block-extra (= ${binary:Version}),
:ubuntu:Conflicts: qemu-user (<< 0.11.1-2), qemu-kvm (<< 1.2.0.dfsg-1)
:ubuntu:Replaces: qemu-user (<< 0.11.1-2), qemu-kvm (<< 1.2.0.dfsg-1)
Description: QEMU utilities
diff --git a/debian/patches/qemu-tcg-fix-mem-corruption-during-live-migration.diff b/debian/patches/qemu-tcg-fix-mem-corruption-during-live-migration.diff
new file mode 100644
index 0000000000..85924ce76e
--- /dev/null
+++ b/debian/patches/qemu-tcg-fix-mem-corruption-during-live-migration.diff
@@ -0,0 +1,17 @@
+Description: tcg: fix memory corruption during live-migration
+Author: Pavel Boldin <pboldin@mirantis.com>
+Origin: https://launchpadlibrarian.net/216763913/tcg-commit-on-log-global-start.patch
+Bug: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1493049
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1493049
+Last-Update: 20150917
+
+--- a/exec.c
++++ b/exec.c
+@@ -526,6 +526,7 @@
+ cpu->tcg_as_listener = g_new0(MemoryListener, 1);
+ }
+ cpu->tcg_as_listener->commit = tcg_commit;
++ cpu->tcg_as_listener->log_global_start = tcg_commit;
+ memory_listener_register(cpu->tcg_as_listener, as);
+ }
+ #endif
diff --git a/debian/patches/qemu-tracing-vl-drop-g-mem-set-vtable-call.diff b/debian/patches/qemu-tracing-vl-drop-g-mem-set-vtable-call.diff
new file mode 100644
index 0000000000..9163b12a0c
--- /dev/null
+++ b/debian/patches/qemu-tracing-vl-drop-g-mem-set-vtable-call.diff
@@ -0,0 +1,64 @@
+Description: vl.c: don't try to insert malloc tracepoints on newer glibc (v2)
+ [Qemu-devel] [PATCH] vl.c: don't try to insert malloc tracepoints on newer glib (v2)
+Author: Serge Hallyn <serge.hallyn@ubuntu.com>
+Origin: http://lists.nongnu.org/archive/html/qemu-devel/2015-09/msg01262.html
+Bug: https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/1491972
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/1491972
+Last-Update: 20150917
+
+--- a/vl.c
++++ b/vl.c
+@@ -2545,6 +2545,7 @@
+ return popt;
+ }
+
++#if !GLIB_CHECK_VERSION(2, 44, 0)
+ static gpointer malloc_and_trace(gsize n_bytes)
+ {
+ void *ptr = malloc(n_bytes);
+@@ -2564,6 +2565,24 @@
+ trace_g_free(mem);
+ free(mem);
+ }
++static void register_glib_mem_trace_functions(void)
++{
++ GMemVTable mem_trace = {
++ .malloc = malloc_and_trace,
++ .realloc = realloc_and_trace,
++ .free = free_and_trace,
++ };
++
++ g_mem_set_vtable(&mem_trace);
++}
++#else
++static void register_glib_mem_trace_functions(void)
++{
++ /* Newer versions of glib don't support intercepting the
++ * memory allocation functions.
++ */
++}
++#endif
+
+ static int machine_set_property(const char *name, const char *value,
+ void *opaque)
+@@ -2760,11 +2779,6 @@
+ bool userconfig = true;
+ const char *log_mask = NULL;
+ const char *log_file = NULL;
+- GMemVTable mem_trace = {
+- .malloc = malloc_and_trace,
+- .realloc = realloc_and_trace,
+- .free = free_and_trace,
+- };
+ const char *trace_events = NULL;
+ const char *trace_file = NULL;
+ ram_addr_t maxram_size;
+@@ -2779,7 +2793,7 @@
+ error_set_progname(argv[0]);
+ qemu_init_exec_dir(argv[0]);
+
+- g_mem_set_vtable(&mem_trace);
++ register_glib_mem_trace_functions();
+
+ module_call_init(MODULE_INIT_QOM);
+
diff --git a/debian/patches/qemu-vmdk-fix-next-cluster-sector-for-compressed-write-round-next-consecutive-sector.diff b/debian/patches/qemu-vmdk-fix-next-cluster-sector-for-compressed-write-round-next-consecutive-sector.diff
new file mode 100644
index 0000000000..3b8bfd7382
--- /dev/null
+++ b/debian/patches/qemu-vmdk-fix-next-cluster-sector-for-compressed-write-round-next-consecutive-sector.diff
@@ -0,0 +1,24 @@
+Description: vmdk: Fix next_cluster_sector for compressed write (rounding)
+Author: Radoslav Gerganov <rgerganov@vmware.com>
+Origin: https://github.com/qemu/qemu/commit/3efffc3292d94271a15b1606b4a56adf6c6f04ed
+Bug: https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/1006655
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/1006655
+Last-Update: 20150917
+
+--- a/block/vmdk.c
++++ b/block/vmdk.c
+@@ -1327,8 +1327,12 @@
+
+ write_end_sector = DIV_ROUND_UP(write_offset + write_len, BDRV_SECTOR_SIZE);
+
+- extent->next_cluster_sector = MAX(extent->next_cluster_sector,
+- write_end_sector);
++ if (extent->compressed) {
++ extent->next_cluster_sector = write_end_sector;
++ } else {
++ extent->next_cluster_sector = MAX(extent->next_cluster_sector,
++ write_end_sector);
++ }
+
+ if (ret != write_len) {
+ ret = ret < 0 ? ret : -EIO;
diff --git a/debian/patches/qemu-vmdk-fix-next-cluster-sector-for-compressed-write.diff b/debian/patches/qemu-vmdk-fix-next-cluster-sector-for-compressed-write.diff
new file mode 100644
index 0000000000..0f91fdcd6d
--- /dev/null
+++ b/debian/patches/qemu-vmdk-fix-next-cluster-sector-for-compressed-write.diff
@@ -0,0 +1,37 @@
+Description: vmdk: Fix next_cluster_sector for compressed write
+Author: Fam Zheng <famz@redhat.com>
+Origin: https://github.com/qemu/qemu/commit/5e82a31eb967db135fc4e688b134fb0972d62de3
+Bug: https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/1006655
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/1006655
+Last-Update: 20150917
+
+--- a/block/vmdk.c
++++ b/block/vmdk.c
+@@ -1302,6 +1302,8 @@
+ uLongf buf_len;
+ const uint8_t *write_buf = buf;
+ int write_len = nb_sectors * 512;
++ int64_t write_offset;
++ int64_t write_end_sector;
+
+ if (extent->compressed) {
+ if (!extent->has_marker) {
+@@ -1320,10 +1322,14 @@
+ write_buf = (uint8_t *)data;
+ write_len = buf_len + sizeof(VmdkGrainMarker);
+ }
+- ret = bdrv_pwrite(extent->file,
+- cluster_offset + offset_in_cluster,
+- write_buf,
+- write_len);
++ write_offset = cluster_offset + offset_in_cluster,
++ ret = bdrv_pwrite(extent->file, write_offset, write_buf, write_len);
++
++ write_end_sector = DIV_ROUND_UP(write_offset + write_len, BDRV_SECTOR_SIZE);
++
++ extent->next_cluster_sector = MAX(extent->next_cluster_sector,
++ write_end_sector);
++
+ if (ret != write_len) {
+ ret = ret < 0 ? ret : -EIO;
+ goto out;
diff --git a/debian/patches/series b/debian/patches/series
index 2e80272cd8..09941628f9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -31,3 +31,7 @@ CVE-2015-5166.patch
CVE-2015-5745.patch
CVE-2015-5225.patch
qcow2-handle-eagain-from-update_refcount
+qemu-vmdk-fix-next-cluster-sector-for-compressed-write.diff
+qemu-vmdk-fix-next-cluster-sector-for-compressed-write-round-next-consecutive-sector.diff
+qemu-tcg-fix-mem-corruption-during-live-migration.diff
+qemu-tracing-vl-drop-g-mem-set-vtable-call.diff
|