[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/9 v3] Add API to free memory used by creating head
From: |
Qiao Nuohan |
Subject: |
[Qemu-devel] [PATCH 7/9 v3] Add API to free memory used by creating header, bitmap and page |
Date: |
Fri, 17 May 2013 11:25:02 +0800 |
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 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
- [Qemu-devel] [PATCH 0/9 v3] Make monitor command 'dump-guest-memory' dump in kdump-compressed format, Qiao Nuohan, 2013/05/16
- [Qemu-devel] [PATCH 3/9 v3] Move includes and struct definition to dump.h, Qiao Nuohan, 2013/05/16
- [Qemu-devel] [PATCH 5/9 v3] Add API to create data of dump bitmap, Qiao Nuohan, 2013/05/16
- [Qemu-devel] [PATCH 1/9 v3] Add API to manipulate dump_bitmap, Qiao Nuohan, 2013/05/16
- [Qemu-devel] [PATCH 7/9 v3] Add API to free memory used by creating header, bitmap and page,
Qiao Nuohan <=
- [Qemu-devel] [PATCH 2/9 v3] Add API to manipulate cache_data, Qiao Nuohan, 2013/05/16
- [Qemu-devel] [PATCH 4/9 v3] Add API to create header of vmcore, Qiao Nuohan, 2013/05/16
- [Qemu-devel] [PATCH 6/9 v3] Add API to create page, Qiao Nuohan, 2013/05/16
- [Qemu-devel] [PATCH 8/9 v3] Add API to write header, bitmap and page into vmcore, Qiao Nuohan, 2013/05/16
- [Qemu-devel] [PATCH 9/9 v3] Make monitor command 'dump-guest-memory' dump in kdump-compressed format, Qiao Nuohan, 2013/05/16
- Re: [Qemu-devel] [PATCH 0/9 v3] Make monitor command 'dump-guest-memory' dump in kdump-compressed format, Qiao Nuohan, 2013/05/19
- Re: [Qemu-devel] [PATCH 0/9 v3] Make monitor command 'dump-guest-memory' dump in kdump-compressed format, Qiao Nuohan, 2013/05/22
- Re: [Qemu-devel] [PATCH 0/9 v3] Make monitor command 'dump-guest-memory' dump in kdump-compressed format, Andreas Färber, 2013/05/22