From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W448s-0008EQ-P8 for qemu-devel@nongnu.org; Fri, 17 Jan 2014 02:47:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W448m-0003TV-9P for qemu-devel@nongnu.org; Fri, 17 Jan 2014 02:47:02 -0500 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:38931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W448l-0003Sq-PA for qemu-devel@nongnu.org; Fri, 17 Jan 2014 02:46:56 -0500 Received: from m2.gw.fujitsu.co.jp (unknown [10.0.50.72]) by fgwmail6.fujitsu.co.jp (Postfix) with ESMTP id 22A6A3EE0D0 for ; Fri, 17 Jan 2014 16:46:54 +0900 (JST) Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 0182245DE50 for ; Fri, 17 Jan 2014 16:46:54 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.nic.fujitsu.com [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id D302145DE4E for ; Fri, 17 Jan 2014 16:46:53 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id BF5EB1DB8038 for ; Fri, 17 Jan 2014 16:46:53 +0900 (JST) Received: from s00.gw.fujitsu.co.jp (s00.gw.nic.fujitsu.com [133.161.11.15]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 5E2EFE08005 for ; Fri, 17 Jan 2014 16:46:53 +0900 (JST) Received: from s00.gw.fujitsu.co.jp (kw-mxio2.gw.nic.fujitsu.com [10.0.237.142]) by s00.gw.fujitsu.co.jp (Postfix) with ESMTP id 2E7411180D4 for ; Fri, 17 Jan 2014 16:46:51 +0900 (JST) Received: from G08FNSTD100518.localdomain (unknown [10.167.226.68]) by s00.gw.fujitsu.co.jp (Postfix) with ESMTP id 172FDAC48F for ; Fri, 17 Jan 2014 16:46:51 +0900 (JST) From: qiaonuohan Date: Fri, 17 Jan 2014 15:46:08 +0800 Message-Id: <1389944779-31899-3-git-send-email-qiaonuohan@cn.fujitsu.com> In-Reply-To: <1389944779-31899-1-git-send-email-qiaonuohan@cn.fujitsu.com> References: <1389944779-31899-1-git-send-email-qiaonuohan@cn.fujitsu.com> Subject: [Qemu-devel] [PATCH 02/13 v7] 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