[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 7/9] dump: Add API to free memory used by creatin
From: |
qiaonuohan |
Subject: |
[Qemu-devel] [PATCH v4 7/9] dump: Add API to free memory used by creating header, bitmap and page |
Date: |
Tue, 28 May 2013 10:50:35 +0800 |
From: Qiao Nuohan <address@hidden>
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
memory.
Signed-off-by: Qiao Nuohan <address@hidden>
Reviewed-by: Zhang Xiaohe <address@hidden>
---
dump.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/dump.c b/dump.c
index 405eeb1..91a2384 100644
--- a/dump.c
+++ b/dump.c
@@ -1261,6 +1261,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
- [Qemu-devel] [PATCH v4 0/9] Make 'dump-guest-memory' dump in kdump-compressed format, qiaonuohan, 2013/05/27
- [Qemu-devel] [PATCH v4 3/9] dump: Move struct definition into dump_memroy.h, qiaonuohan, 2013/05/27
- [Qemu-devel] [PATCH v4 1/9] dump: Add API to manipulate dump_bitmap, qiaonuohan, 2013/05/27
- [Qemu-devel] [PATCH v4 7/9] dump: Add API to free memory used by creating header, bitmap and page,
qiaonuohan <=
- [Qemu-devel] [PATCH v4 2/9] dump: Add API to manipulate cache_data, qiaonuohan, 2013/05/27
- [Qemu-devel] [PATCH v4 5/9] dump: Add API to create data of dump bitmap, qiaonuohan, 2013/05/27
- [Qemu-devel] [PATCH v4 4/9] dump: Add API to create header of vmcore, qiaonuohan, 2013/05/27
- [Qemu-devel] [PATCH v4 8/9] dump: Add API to write header, bitmap and page into vmcore, qiaonuohan, 2013/05/27
- [Qemu-devel] [PATCH v4 6/9] dump: Add API to create page, qiaonuohan, 2013/05/27
- [Qemu-devel] [PATCH v4 9/9] dump: Make kdump-compressed format available for 'dump-guest-memory', qiaonuohan, 2013/05/27