[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 1/9] dump: Add argument to write_elfxx_notes
From: |
Qiao Nuohan |
Subject: |
[Qemu-devel] [PATCH v5 1/9] dump: Add argument to write_elfxx_notes |
Date: |
Tue, 9 Jul 2013 15:30:06 +0800 |
write_elf32_notes/wirte_elf64_notes use fd_write_vmcore to write elf notes to
vmcore. Adding argument "WriteCoreDumpFunction f" makes it available to choose
the way of writing elf notes when calling these two functions.
Signed-off-by: Qiao Nuohan <address@hidden>
Reviewed-by: Zhang Xiaohe <address@hidden>
---
dump.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dump.c b/dump.c
index c812cfa..4e478b1 100644
--- a/dump.c
+++ b/dump.c
@@ -273,7 +273,7 @@ static inline int cpu_index(CPUState *cpu)
return cpu->cpu_index + 1;
}
-static int write_elf64_notes(DumpState *s)
+static int write_elf64_notes(WriteCoreDumpFunction f, DumpState *s)
{
CPUArchState *env;
CPUState *cpu;
@@ -283,7 +283,7 @@ static int write_elf64_notes(DumpState *s)
for (env = first_cpu; env != NULL; env = env->next_cpu) {
cpu = ENV_GET_CPU(env);
id = cpu_index(cpu);
- ret = cpu_write_elf64_note(fd_write_vmcore, cpu, id, s);
+ ret = cpu_write_elf64_note(f, cpu, id, s);
if (ret < 0) {
dump_error(s, "dump: failed to write elf notes.\n");
return -1;
@@ -291,7 +291,7 @@ static int write_elf64_notes(DumpState *s)
}
for (env = first_cpu; env != NULL; env = env->next_cpu) {
- ret = cpu_write_elf64_qemunote(fd_write_vmcore, cpu, s);
+ ret = cpu_write_elf64_qemunote(f, cpu, s);
if (ret < 0) {
dump_error(s, "dump: failed to write CPU status.\n");
return -1;
@@ -325,7 +325,7 @@ static int write_elf32_note(DumpState *s)
return 0;
}
-static int write_elf32_notes(DumpState *s)
+static int write_elf32_notes(WriteCoreDumpFunction f, DumpState *s)
{
CPUArchState *env;
CPUState *cpu;
@@ -335,7 +335,7 @@ static int write_elf32_notes(DumpState *s)
for (env = first_cpu; env != NULL; env = env->next_cpu) {
cpu = ENV_GET_CPU(env);
id = cpu_index(cpu);
- ret = cpu_write_elf32_note(fd_write_vmcore, cpu, id, s);
+ ret = cpu_write_elf32_note(f, cpu, id, s);
if (ret < 0) {
dump_error(s, "dump: failed to write elf notes.\n");
return -1;
@@ -343,7 +343,7 @@ static int write_elf32_notes(DumpState *s)
}
for (env = first_cpu; env != NULL; env = env->next_cpu) {
- ret = cpu_write_elf32_qemunote(fd_write_vmcore, cpu, s);
+ ret = cpu_write_elf32_qemunote(f, cpu, s);
if (ret < 0) {
dump_error(s, "dump: failed to write CPU status.\n");
return -1;
@@ -562,7 +562,7 @@ static int dump_begin(DumpState *s)
}
/* write notes to vmcore */
- if (write_elf64_notes(s) < 0) {
+ if (write_elf64_notes(fd_write_vmcore, s) < 0) {
return -1;
}
@@ -585,7 +585,7 @@ static int dump_begin(DumpState *s)
}
/* write notes to vmcore */
- if (write_elf32_notes(s) < 0) {
+ if (write_elf32_notes(fd_write_vmcore, s) < 0) {
return -1;
}
}
--
1.7.1
- [Qemu-devel] [PATCH v5 0/9] Make 'dump-guest-memory' dump in kdump-compressed format, Qiao Nuohan, 2013/07/09
- [Qemu-devel] [PATCH v5 1/9] dump: Add argument to write_elfxx_notes,
Qiao Nuohan <=
- [Qemu-devel] [PATCH v5 2/9] dump: Add API to write header of flatten format, Qiao Nuohan, 2013/07/09
- [Qemu-devel] [PATCH v5 3/9] dump: Add API to write vmcore, Qiao Nuohan, 2013/07/09
- [Qemu-devel] [PATCH v5 7/9] dump: Add APIs to operate DataCache, Qiao Nuohan, 2013/07/09
- [Qemu-devel] [PATCH v5 4/9] dump: Add API to write elf notes to buffer, Qiao Nuohan, 2013/07/09
- [Qemu-devel] [PATCH v5 6/9] dump: Add API to write dump_bitmap, Qiao Nuohan, 2013/07/09
- [Qemu-devel] [PATCH v5 9/9] dump: Make kdump-compressed format available for 'dump-guest-memory', Qiao Nuohan, 2013/07/09
- [Qemu-devel] [PATCH v5 8/9] dump: Add API to write dump pages, Qiao Nuohan, 2013/07/09