From: qiaonuohan@cn.fujitsu.com
To: qemu-devel@nongnu.org
Cc: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>,
d.hatayama@jp.fujitsu.com, zhangxh@cn.fujitsu.com,
anderson@redhat.com, kumagai-atsushi@mxc.nes.nec.co.jp,
afaerber@suse.de
Subject: [Qemu-devel] [PATCH 7/9 v2] Add API to free buf used by creating header, bitmap and page
Date: Wed, 8 May 2013 10:12:59 +0800 [thread overview]
Message-ID: <1367979181-24679-8-git-send-email-qiaonuohan@cn.fujitsu.com> (raw)
In-Reply-To: <1367979181-24679-1-git-send-email-qiaonuohan@cn.fujitsu.com>
From: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
When calling create_header, create_dump_bitmap and create_pages, some memory spaces
are allocated. The following patch will use this function to free these spaces.
Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Reviewed-by: Zhang Xiaohe <zhangxh@cn.fujitsu.com>
---
dump.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/dump.c b/dump.c
index ebfb190..75ef032 100644
--- a/dump.c
+++ b/dump.c
@@ -1252,6 +1252,25 @@ cleanup:
return -1;
}
+static void clean_state(DumpState *s)
+{
+ if (s->dh) {
+ g_free(s->dh);
+ }
+
+ if (s->kh) {
+ g_free(s->kh);
+ }
+
+ free_dump_bitmap(s->dump_bitmap1);
+
+ free_dump_bitmap(s->dump_bitmap2);
+
+ free_cache_data(s->page_desc);
+
+ free_cache_data(s->page_data);
+}
+
void qmp_dump_guest_memory(bool paging, const char *file, bool has_begin,
int64_t begin, bool has_length, int64_t length,
Error **errp)
--
1.7.1
next prev parent reply other threads:[~2013-05-13 3:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-08 2:12 [Qemu-devel] [PATCH 0/9 v2] Make monitor command 'dump-guest-memory' dump in kdump-compressed format qiaonuohan
2013-05-08 2:12 ` [Qemu-devel] [PATCH 1/9 v2] Add API to manipulate dump_bitmap qiaonuohan
2013-05-08 2:12 ` [Qemu-devel] [PATCH 2/9 v2] Add API to manipulate cache_data qiaonuohan
2013-05-08 2:12 ` [Qemu-devel] [PATCH 3/9 v2] Move includes and struct definition to dump.h qiaonuohan
2013-05-08 2:12 ` [Qemu-devel] [PATCH 4/9 v2] Add API to create header of vmcore qiaonuohan
2013-05-08 2:12 ` [Qemu-devel] [PATCH 5/9 v2] Add API to create data of dump bitmap qiaonuohan
2013-05-08 2:12 ` [Qemu-devel] [PATCH 6/9 v2] Add API to create page qiaonuohan
2013-05-08 2:12 ` qiaonuohan [this message]
2013-05-08 2:13 ` [Qemu-devel] [PATCH 8/9 v2] Add API to write header, bitmap and page into vmcore qiaonuohan
2013-05-08 2:13 ` [Qemu-devel] [PATCH 9/9 v2] Make monitor command 'dump-guest-memory' dump in kdump-compressed format qiaonuohan
-- strict thread matches above, loose matches on Subject: below --
2013-05-15 2:29 [Qemu-devel] [PATCH 0/9 " Qiao Nuohan
2013-05-15 2:29 ` [Qemu-devel] [PATCH 7/9 v2] Add API to free buf used by creating header, bitmap and page Qiao Nuohan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1367979181-24679-8-git-send-email-qiaonuohan@cn.fujitsu.com \
--to=qiaonuohan@cn.fujitsu.com \
--cc=afaerber@suse.de \
--cc=anderson@redhat.com \
--cc=d.hatayama@jp.fujitsu.com \
--cc=kumagai-atsushi@mxc.nes.nec.co.jp \
--cc=qemu-devel@nongnu.org \
--cc=zhangxh@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).