From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: anthony@codemonkey.ws
Subject: [Qemu-devel] [PATCH v3 08/29] dump: change cpu_get_note_size to return ssize_t
Date: Thu, 7 Jun 2012 09:39:53 +0200 [thread overview]
Message-ID: <1339054814-20939-9-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1339054814-20939-1-git-send-email-pbonzini@redhat.com>
So that it can use the same prototype in both cases. Check for failure.
Cc: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
cpu-all.h | 4 ++--
dump.c | 9 +++++++--
target-i386/arch_dump.c | 2 +-
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/cpu-all.h b/cpu-all.h
index e8749de..624030d 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -552,7 +552,7 @@ int cpu_write_elf64_qemunote(write_core_dump_function f, CPUArchState *env,
int cpu_write_elf32_qemunote(write_core_dump_function f, CPUArchState *env,
void *opaque);
int cpu_get_dump_info(ArchDumpInfo *info);
-size_t cpu_get_note_size(int class, int machine, int nr_cpus);
+ssize_t cpu_get_note_size(int class, int machine, int nr_cpus);
#else
static inline int cpu_write_elf64_note(write_core_dump_function f,
CPUArchState *env, int cpuid,
@@ -587,7 +587,7 @@ static inline int cpu_get_dump_info(ArchDumpInfo *info)
return -1;
}
-static inline int cpu_get_note_size(int class, int machine, int nr_cpus)
+static inline ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
{
return -1;
}
diff --git a/dump.c b/dump.c
index 0ca14f8..b24d4be 100644
--- a/dump.c
+++ b/dump.c
@@ -750,6 +750,13 @@ static int dump_init(DumpState *s, int fd, bool paging, bool has_filter,
goto cleanup;
}
+ s->note_size = cpu_get_note_size(s->dump_info.d_class,
+ s->dump_info.d_machine, nr_cpus);
+ if (ret < 0) {
+ error_set(errp, QERR_UNSUPPORTED);
+ goto cleanup;
+ }
+
/* get memory mapping */
memory_mapping_list_init(&s->list);
if (paging) {
@@ -784,8 +791,6 @@ static int dump_init(DumpState *s, int fd, bool paging, bool has_filter,
}
}
- s->note_size = cpu_get_note_size(s->dump_info.d_class,
- s->dump_info.d_machine, nr_cpus);
if (s->dump_info.d_class == ELFCLASS64) {
if (s->have_section) {
s->memory_offset = sizeof(Elf64_Ehdr) +
diff --git a/target-i386/arch_dump.c b/target-i386/arch_dump.c
index 135d855..7c2b514 100644
--- a/target-i386/arch_dump.c
+++ b/target-i386/arch_dump.c
@@ -415,7 +415,7 @@ int cpu_get_dump_info(ArchDumpInfo *info)
return 0;
}
-size_t cpu_get_note_size(int class, int machine, int nr_cpus)
+ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
{
int name_size = 5; /* "CORE" or "QEMU" */
size_t elf_note_size = 0;
--
1.7.10.1
next prev parent reply other threads:[~2012-06-07 7:41 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-07 7:39 [Qemu-devel] [PULL v3 00/29] per-directory Makefile.objs snippets, limit vpath (ab)use Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 01/29] build: remove trace-nested-y Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 02/29] build: do not sprinkle around GENERATED_HEADERS dependencies Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 03/29] build: add rules for nesting Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 04/29] build: move *-user/ objects to nested Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 05/29] build: move obj-TARGET-y variables " Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 06/29] build: move libobj-y variable " Paolo Bonzini
2012-06-07 21:10 ` Blue Swirl
2012-06-07 23:18 ` Paolo Bonzini
2012-06-08 8:03 ` Andreas Färber
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 07/29] dump: do not compile dump.o for user-mode emulation Paolo Bonzini
2012-06-07 7:39 ` Paolo Bonzini [this message]
2012-06-11 1:52 ` [Qemu-devel] [PATCH v3 08/29] dump: change cpu_get_note_size to return ssize_t Wen Congyang
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 09/29] dump: remove dumping stuff from cpu-all.h Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 10/29] build: move other target-*/ objects to nested Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 11/29] build: move rules for nesting to Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 12/29] build: adapt qom/Makefile and move it " Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 13/29] build: move block/ objects to nested Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 14/29] build: move net/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 15/29] build: move fsdev/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 16/29] build: move ui/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 17/29] build: move audio/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 18/29] build: move slirp/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 19/29] build: move qapi/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 20/29] build: move qga/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 21/29] build: move target-independent hw/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 22/29] build: convert libhw " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 23/29] build: move per-target hw/ objects " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 24/29] build: move device tree to per-target Makefile.objs Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 25/29] build: libcacard Makefile cleanups Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 26/29] build: limit usage of vpath Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 27/29] build: compile oslib-obj-y once Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 28/29] configure: ensure directory exists when creating symlink Paolo Bonzini
2012-06-12 18:44 ` Andreas Färber
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 29/29] build: do not create directories at configure time Paolo Bonzini
2012-06-07 12:31 ` [Qemu-devel] [PULL v3 00/29] per-directory Makefile.objs snippets, limit vpath (ab)use Andreas Färber
2012-06-07 12:47 ` Anthony Liguori
2012-06-07 14:14 ` Paolo Bonzini
2012-06-08 13:59 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339054814-20939-9-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).