Merge lp:~serge-hallyn/ubuntu/lucid/qemu-kvm/memleak-fix into lp:ubuntu/lucid/qemu-kvm

Proposed by Serge Hallyn
Status: Superseded
Proposed branch: lp:~serge-hallyn/ubuntu/lucid/qemu-kvm/memleak-fix
Merge into: lp:ubuntu/lucid/qemu-kvm
Diff against target: 123 lines (+87/-0)
5 files modified
debian/changelog (+15/-0)
debian/patches/block-Fix-multiwrite-memory-leak-in-error-case.patch (+30/-0)
debian/patches/block-Free-iovec-arrays-allocated-by-multiwrite_merge (+29/-0)
debian/patches/series (+2/-0)
debian/rules (+11/-0)
To merge this branch: bzr merge lp:~serge-hallyn/ubuntu/lucid/qemu-kvm/memleak-fix
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
Review via email: mp+28119@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dave Walker (davewalker) wrote :

You need to set the release pocket as lucid-proposed.. and personally.. the changelog doesn't fill me with confidence, :)

74. By Serge Hallyn

Fix the debian/changelog: point out that the fix has been confirmed,
and change pocket to lucid-proposed.

75. By Serge Hallyn

Address review feedback:
 rename debian/patches/block-Free-iovec-arrays-allocated-by-multiwrite_merge to
  debian/patches/block-Free-iovec-arrays-allocated-by-multiwrite_merge.patch
 add DEB-3 patch annotations to the patches being added

76. By Serge Hallyn

remove the debian/rules block to enable parallel build, which was
accidentally left in.

Unmerged revisions

76. By Serge Hallyn

remove the debian/rules block to enable parallel build, which was
accidentally left in.

75. By Serge Hallyn

Address review feedback:
 rename debian/patches/block-Free-iovec-arrays-allocated-by-multiwrite_merge to
  debian/patches/block-Free-iovec-arrays-allocated-by-multiwrite_merge.patch
 add DEB-3 patch annotations to the patches being added

74. By Serge Hallyn

Fix the debian/changelog: point out that the fix has been confirmed,
and change pocket to lucid-proposed.

73. By Serge Hallyn

add the new patch file to bzr index

72. By Serge Hallyn

Previous patch did not fix memleak for everyone. Here is another patch
which David Weber says does (LP: #588293)

71. By Serge Hallyn

fix version and pocket

70. By Serge Hallyn

Apply a patch to fix a slow (but huge) memory leak (LP: #588293)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-04-23 18:45:55 +0000
3+++ debian/changelog 2010-06-28 12:40:52 +0000
4@@ -1,3 +1,18 @@
5+qemu-kvm (0.12.3+noroms-0ubuntu9.2) lucid-proposed; urgency=low
6+
7+ * Previous patch did not fix memleak for everyone. Appending another
8+ separate memleak fix patch. This package (tried out in
9+ ppa:serge-hallyn/virt/ubuntu) was confirmed by David Weber to fix
10+ his memory leak. (LP: #588293)
11+
12+ -- Serge Hallyn <serge.hallyn@canonical.com> Mon, 21 Jun 2010 11:55:23 -0500
13+
14+qemu-kvm (0.12.3+noroms-0ubuntu9.1) lucid-proposed; urgency=low
15+
16+ * Apply a patch to fix a slow (but huge) memory leak (LP: #588293)
17+
18+ -- Serge Hallyn <serge.hallyn@canonical.com> Tue, 15 Jun 2010 07:52:46 -0500
19+
20 qemu-kvm (0.12.3+noroms-0ubuntu9) lucid; urgency=low
21
22 * Architecture-specific fixes (LP: #568904)
23
24=== added file 'debian/patches/block-Fix-multiwrite-memory-leak-in-error-case.patch'
25--- debian/patches/block-Fix-multiwrite-memory-leak-in-error-case.patch 1970-01-01 00:00:00 +0000
26+++ debian/patches/block-Fix-multiwrite-memory-leak-in-error-case.patch 2010-06-28 12:40:52 +0000
27@@ -0,0 +1,30 @@
28+commit 7eb58a6c556c3880e6712cbf6d24d681261c5095
29+Author: Kevin Wolf <kwolf@redhat.com>
30+Date: Tue Apr 6 18:24:07 2010 +0200
31+
32+ block: Fix multiwrite memory leak in error case
33+
34+ Previously multiwrite_user_cb was never called if a request in the multiwrite
35+ batch failed right away because it did set mcb->error immediately. Make it look
36+ more like a normal callback to fix this.
37+
38+ (re-based from upstream fix)
39+
40+ Reported-by: Juan Quintela <quintela@redhat.com>
41+ Signed-off-by: Kevin Wolf <kwolf@redhat.com>
42+ Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
43+
44+Index: qemu-kvm-0.12.3+noroms/block.c
45+===================================================================
46+--- qemu-kvm-0.12.3+noroms.orig/block.c 2010-06-15 08:27:50.000000000 -0500
47++++ qemu-kvm-0.12.3+noroms/block.c 2010-06-15 08:29:10.244281888 -0500
48+@@ -1761,7 +1761,8 @@
49+ reqs[i].error = EIO;
50+ goto fail;
51+ } else {
52+- mcb->error = EIO;
53++ mcb->num_requests++;
54++ multiwrite_cb(mcb, -EIO);
55+ break;
56+ }
57+ } else {
58
59=== added file 'debian/patches/block-Free-iovec-arrays-allocated-by-multiwrite_merge'
60--- debian/patches/block-Free-iovec-arrays-allocated-by-multiwrite_merge 1970-01-01 00:00:00 +0000
61+++ debian/patches/block-Free-iovec-arrays-allocated-by-multiwrite_merge 2010-06-28 12:40:52 +0000
62@@ -0,0 +1,29 @@
63+commit 012d4869c1eb195e83f159ed7b2bced33f37f960
64+Author: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
65+Date: Wed Apr 21 20:35:45 2010 +0100
66+
67+ block: Free iovec arrays allocated by multiwrite_merge()
68+
69+ A new iovec array is allocated when creating a merged write request.
70+ This patch ensures that the iovec array is deleted in addition to its
71+ qiov owner.
72+
73+ Reported-by: Leszek Urbanski <tygrys@moo.pl>
74+ Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
75+ Signed-off-by: Kevin Wolf <kwolf@redhat.com>
76+ (cherry picked from commit 1e1ea48d42e011b9bdd0d689d184e7cac4617b66)
77+
78+diff --git a/block.c b/block.c
79+index 4f9a48b..7326bfe 100644
80+--- a/block.c
81++++ b/block.c
82+@@ -1608,6 +1608,9 @@ static void multiwrite_user_cb(MultiwriteCB *mcb)
83+
84+ for (i = 0; i < mcb->num_callbacks; i++) {
85+ mcb->callbacks[i].cb(mcb->callbacks[i].opaque, mcb->error);
86++ if (mcb->callbacks[i].free_qiov) {
87++ qemu_iovec_destroy(mcb->callbacks[i].free_qiov);
88++ }
89+ qemu_free(mcb->callbacks[i].free_qiov);
90+ qemu_vfree(mcb->callbacks[i].free_buf);
91+ }
92
93=== modified file 'debian/patches/series'
94--- debian/patches/series 2010-04-01 00:22:02 +0000
95+++ debian/patches/series 2010-06-28 12:40:52 +0000
96@@ -9,3 +9,5 @@
97 arm-higher-initrd-load-address.patch
98 larger_default_ram_size.patch
99 SDL-wrong-behaviour-of-caps-lock.patch
100+block-Fix-multiwrite-memory-leak-in-error-case.patch
101+block-Free-iovec-arrays-allocated-by-multiwrite_merge
102
103=== modified file 'debian/rules'
104--- debian/rules 2010-04-23 18:45:55 +0000
105+++ debian/rules 2010-06-28 12:40:52 +0000
106@@ -7,6 +7,17 @@
107 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
108 DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
109
110+ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
111+ INSTALL_PROGRAM += -s
112+endif
113+
114+# Handle DEB_BUILD_OPTIONS=parallel=N
115+, := ,
116+ifneq (,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS))))
117+ NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(subst $(,), ,$(DEB_BUILD_OPTIONS))))
118+ MAKEFLAGS += -j$(NUMJOBS)
119+endif
120+
121 ifeq ($(DEB_HOST_ARCH_OS),linux)
122 # Note: We differ from Debian here by favoring the pulseaudio driver, since that's default in Ubuntu.
123 # Users override this when calling qemu by exporting the environment variable QEMU_AUDIO_DRV.

Subscribers

People subscribed via source and target branches