From: "Andreas Färber" <afaerber@suse.de>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Jia Liu <proljc@gmail.com>,
Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
Anthony Green <green@moxielogic.com>,
Riku Voipio <riku.voipio@iki.fi>,
qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
Blue Swirl <blauwirbel@gmail.com>,
Max Filippov <jcmvbkbc@gmail.com>,
Michael Walle <michael@walle.cc>,
qemu-ppc@nongnu.org,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Guan Xuetao <gxt@mprc.pku.edu.cn>,
Leon Alrae <leon.alrae@imgtec.com>,
Aurelien Jarno <aurelien@aurel32.net>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 4/4] cpu: Make cpu_init() return QOM object
Date: Tue, 10 Mar 2015 17:23:18 +0100 [thread overview]
Message-ID: <54FF1A76.50500@suse.de> (raw)
In-Reply-To: <54FF18E5.4020207@suse.de>
Am 10.03.2015 um 17:16 schrieb Andreas Färber:
> Am 26.02.2015 um 21:37 schrieb Eduardo Habkost:
>> Instead of making cpu_init() return CPUArchState, return a CPU object.
>>
> [snip]
>
> In file included from
> /home/andreas/QEMU/qemu-cpu/include/exec/cpu-all.h:26:0,
> from /home/andreas/QEMU/qemu-cpu/target-alpha/cpu.h:296,
> from /home/andreas/QEMU/qemu-cpu/linux-user/qemu.h:7,
> from /home/andreas/QEMU/qemu-cpu/linux-user/main.c:29:
> /home/andreas/QEMU/qemu-cpu/linux-user/main.c: In function ‘cpu_copy’:
> /home/andreas/QEMU/qemu-cpu/include/qom/cpu.h:60:18: error:
> initialization from incompatible pointer type [-Werror]
> #define CPU(obj) ((CPUState *)(obj))
> ^
> /home/andreas/QEMU/qemu-cpu/target-alpha/cpu.h:432:29: note: in
> expansion of macro ‘CPU’
> #define cpu_init(cpu_model) CPU(cpu_alpha_init(cpu_model))
> ^
> /home/andreas/QEMU/qemu-cpu/linux-user/main.c:3455:29: note: in
> expansion of macro ‘cpu_init’
> CPUArchState *new_env = cpu_init(cpu_model);
> ^
> cc1: all warnings being treated as errors
> /home/andreas/QEMU/qemu-cpu/rules.mak:57: recipe for target
> 'linux-user/main.o' failed
> make[1]: *** [linux-user/main.o] Error 1
The following fixes it for me:
diff --git a/linux-user/main.c b/linux-user/main.c
index dd33665..6bd23af 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3452,8 +3452,8 @@ void init_task_state(TaskState *ts)
CPUArchState *cpu_copy(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
- CPUArchState *new_env = cpu_init(cpu_model);
- CPUState *new_cpu = ENV_GET_CPU(new_env);
+ CPUState *new_cpu = cpu_init(cpu_model);
+ CPUArchState *new_env = cpu->env_ptr;
CPUBreakpoint *bp;
CPUWatchpoint *wp;
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)
next prev parent reply other threads:[~2015-03-10 16:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 20:37 [Qemu-devel] [PATCH 0/4] cpu: Make cpu_init() return QOM object Eduardo Habkost
2015-02-26 20:37 ` [Qemu-devel] [PATCH 1/4] target-unicore32: Make uc32_cpu_init() return UniCore32CPU Eduardo Habkost
2015-02-26 20:37 ` [Qemu-devel] [PATCH 2/4] m68k: Use cpu_m68k_init() Eduardo Habkost
2015-02-26 20:37 ` [Qemu-devel] [PATCH 3/4] unicore32: Use uc32_cpu_init() Eduardo Habkost
2015-02-26 20:37 ` [Qemu-devel] [PATCH 4/4] cpu: Make cpu_init() return QOM object Eduardo Habkost
2015-03-10 16:16 ` Andreas Färber
2015-03-10 16:23 ` Andreas Färber [this message]
2015-03-10 16:35 ` Eduardo Habkost
2015-02-27 14:40 ` [Qemu-devel] [PATCH 0/4] " Andreas Färber
2015-03-10 17:02 ` Andreas Färber
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=54FF1A76.50500@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=ehabkost@redhat.com \
--cc=green@moxielogic.com \
--cc=gxt@mprc.pku.edu.cn \
--cc=jcmvbkbc@gmail.com \
--cc=kbastian@mail.uni-paderborn.de \
--cc=leon.alrae@imgtec.com \
--cc=michael@walle.cc \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=proljc@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=rth@twiddle.net \
/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).