[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/22] dump: add argument to write_elfxx_notes
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 06/22] dump: add argument to write_elfxx_notes |
Date: |
Thu, 13 Feb 2014 10:30:24 -0500 |
From: qiaonuohan <address@hidden>
write_elf32_notes/wirte_elf64_notes use fd_write_vmcore to write elf notes to
vmcore. Adding parameter "WriteCoreDumpFunction f" makes it available to choose
the method of writing elf notes
Signed-off-by: Qiao Nuohan <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
dump.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dump.c b/dump.c
index 42622de..c9d3492 100644
--- a/dump.c
+++ b/dump.c
@@ -271,7 +271,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)
{
CPUState *cpu;
int ret;
@@ -279,7 +279,7 @@ static int write_elf64_notes(DumpState *s)
CPU_FOREACH(cpu) {
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;
@@ -287,7 +287,7 @@ static int write_elf64_notes(DumpState *s)
}
CPU_FOREACH(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;
@@ -321,7 +321,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)
{
CPUState *cpu;
int ret;
@@ -329,7 +329,7 @@ static int write_elf32_notes(DumpState *s)
CPU_FOREACH(cpu) {
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;
@@ -337,7 +337,7 @@ static int write_elf32_notes(DumpState *s)
}
CPU_FOREACH(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;
@@ -574,7 +574,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;
}
@@ -597,7 +597,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.8.1.4
- [Qemu-devel] [PULL 00/22] QMP queue, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 01/22] hmp: migrate command (without -d) now blocks correctly, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 02/22] QMP: allow JSON dict arguments in qmp-shell, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 03/22] Use error_is_set() only when necessary, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 05/22] dump: const-qualify the buf of WriteCoreDumpFunction, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 06/22] dump: add argument to write_elfxx_notes,
Luiz Capitulino <=
- [Qemu-devel] [PULL 04/22] qmp: expose list of supported character device backends, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 07/22] dump: add API to write header of flatten format, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 09/22] dump: add API to write elf notes to buffer, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 08/22] dump: add API to write vmcore, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 10/22] dump: add support for lzo/snappy, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 11/22] dump: add members to DumpState and init some of them, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 12/22] dump: add API to write dump header, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 13/22] dump: add API to write dump_bitmap, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 14/22] dump: add APIs to operate DataCache, Luiz Capitulino, 2014/02/13
- [Qemu-devel] [PULL 15/22] dump: add API to write dump pages, Luiz Capitulino, 2014/02/13