From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W824f-0004jb-MR for qemu-devel@nongnu.org; Tue, 28 Jan 2014 01:23:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W824X-0003xF-Gx for qemu-devel@nongnu.org; Tue, 28 Jan 2014 01:23:05 -0500 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:39452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W824X-0003wO-2I for qemu-devel@nongnu.org; Tue, 28 Jan 2014 01:22:57 -0500 Received: from m3.gw.fujitsu.co.jp (unknown [10.0.50.73]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 547AD3EE1D0 for ; Tue, 28 Jan 2014 15:22:56 +0900 (JST) Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 367B045DEBB for ; Tue, 28 Jan 2014 15:22:56 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.nic.fujitsu.com [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 613AA45DEC9 for ; Tue, 28 Jan 2014 15:22:55 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 5210B1DB8044 for ; Tue, 28 Jan 2014 15:22:55 +0900 (JST) Received: from s01.gw.fujitsu.co.jp (s01.gw.nic.fujitsu.com [133.161.11.16]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id E7C2EE18005 for ; Tue, 28 Jan 2014 15:22:54 +0900 (JST) Received: from s01.gw.fujitsu.co.jp (yt-mxio2.gw.nic.fujitsu.com [10.134.25.142]) by s01.gw.fujitsu.co.jp (Postfix) with ESMTP id 12AE2D80CF for ; Tue, 28 Jan 2014 15:22:54 +0900 (JST) Received: from G08FNSTD100518.localdomain (unknown [10.167.226.68]) by s01.gw.fujitsu.co.jp (Postfix) with ESMTP id AE257AC45A for ; Tue, 28 Jan 2014 15:22:53 +0900 (JST) From: qiaonuohan Date: Tue, 28 Jan 2014 14:21:55 +0800 Message-Id: <1390890126-17377-3-git-send-email-qiaonuohan@cn.fujitsu.com> In-Reply-To: <1390890126-17377-1-git-send-email-qiaonuohan@cn.fujitsu.com> References: <1390890126-17377-1-git-send-email-qiaonuohan@cn.fujitsu.com> Subject: [Qemu-devel] [PATCH v8 02/13] dump: add argument to write_elfxx_notes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: lersek@redhat.com, stefanha@gmail.com, lcapitulino@redhat.com, afaerber@suse.de, eblake@redhat.com Cc: kumagai-atsushi@mxc.nes.nec.co.jp, qiaonuohan , anderson@redhat.com, qemu-devel@nongnu.org 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 Reviewed-by: Laszlo Ersek --- dump.c | 16 ++++++++-------- 1 files 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.7.1