From fc9fa4bd0a295ac18808c4cd2cfac484bc4649d3 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 14 May 2012 09:47:20 +0000 Subject: [PATCH 1/4] monitor: Fix memory leak with readline completion Each string which is shown during readline completion in the QEMU monitor is allocated dynamically but currently never deallocated. Add the missing loop which calls g_free for the allocated strings. Signed-off-by: Stefan Weil Reviewed-by: Stefan Hajnoczi --- readline.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readline.c b/readline.c index a6c0039ad..540cd8a02 100644 --- a/readline.c +++ b/readline.c @@ -337,6 +337,9 @@ static void readline_completion(ReadLineState *rs) } readline_show_prompt(rs); } + for (i = 0; i < rs->nb_completions; i++) { + g_free(rs->completions[i]); + } } /* return true if command handled */ From acc55ba8b1519bda27be19fad50b65d2b0c7d26d Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 6 Jun 2012 19:35:57 +0000 Subject: [PATCH 2/4] configure: Fix build for some versions of glibc (9pfs) Some versions declare open_by_handle_at, but don't define AT_EMPTY_PATH. Extend the check in configure to test both preconditions. Signed-off-by: Stefan Weil Acked-by: Stefano Stabellini Acked-by: Serge Hallyn --- configure | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure b/configure index c2366eef4..5d73c8256 100755 --- a/configure +++ b/configure @@ -2812,7 +2812,11 @@ fi open_by_hande_at=no cat > $TMPC << EOF #include +#if !defined(AT_EMPTY_PATH) +# error missing definition +#else int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } +#endif EOF if compile_prog "" "" ; then open_by_handle_at=yes From 352666e2d90ac847a8ac55a6aad9f14ca53b8513 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 10 Jun 2012 19:34:04 +0000 Subject: [PATCH 3/4] dump: Fix license version (GPL2+ instead of GPL2) Signed-off-by: Stefan Weil Signed-off-by: Wen Congyang --- dump-stub.c | 4 ++-- dump.c | 4 ++-- dump.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dump-stub.c b/dump-stub.c index 165c005b4..56d4564f0 100644 --- a/dump-stub.c +++ b/dump-stub.c @@ -6,8 +6,8 @@ * Authors: * Wen Congyang * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. * */ diff --git a/dump.c b/dump.c index 4412d7a3b..2bf8d8d99 100644 --- a/dump.c +++ b/dump.c @@ -6,8 +6,8 @@ * Authors: * Wen Congyang * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. * */ diff --git a/dump.h b/dump.h index 4dea3bb4b..e25b7cfb7 100644 --- a/dump.h +++ b/dump.h @@ -6,8 +6,8 @@ * Authors: * Wen Congyang * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. * */ From fc0608ac144c4b283c38ce5713bd1efa28c60018 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 10 Jun 2012 19:49:18 +0000 Subject: [PATCH 4/4] Fix some more license versions (GPL2+ instead of GPL2) Signed-off-by: Stefan Weil Signed-off-by: Wen Congyang --- memory_mapping-stub.c | 4 ++-- memory_mapping.c | 4 ++-- memory_mapping.h | 4 ++-- target-i386/arch_dump.c | 4 ++-- target-i386/arch_memory_mapping.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/memory_mapping-stub.c b/memory_mapping-stub.c index 104281d78..76be34d89 100644 --- a/memory_mapping-stub.c +++ b/memory_mapping-stub.c @@ -6,8 +6,8 @@ * Authors: * Wen Congyang * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. * */ diff --git a/memory_mapping.c b/memory_mapping.c index 1125e3fcc..6f5a2e3f7 100644 --- a/memory_mapping.c +++ b/memory_mapping.c @@ -6,8 +6,8 @@ * Authors: * Wen Congyang * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. * */ diff --git a/memory_mapping.h b/memory_mapping.h index 3f003586d..ef72b0aba 100644 --- a/memory_mapping.h +++ b/memory_mapping.h @@ -6,8 +6,8 @@ * Authors: * Wen Congyang * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. * */ diff --git a/target-i386/arch_dump.c b/target-i386/arch_dump.c index 7c2b51438..4240278ed 100644 --- a/target-i386/arch_dump.c +++ b/target-i386/arch_dump.c @@ -6,8 +6,8 @@ * Authors: * Wen Congyang * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. * */ diff --git a/target-i386/arch_memory_mapping.c b/target-i386/arch_memory_mapping.c index efb0211fd..8e5a56a3a 100644 --- a/target-i386/arch_memory_mapping.c +++ b/target-i386/arch_memory_mapping.c @@ -6,8 +6,8 @@ * Authors: * Wen Congyang * - * This work is licensed under the terms of the GNU GPL, version 2. See - * the COPYING file in the top-level directory. + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. * */