From: "Andreas Färber" <afaerber@suse.de>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Mark Langsdorf <mark.langsdorf@calxeda.com>
Subject: Re: [Qemu-devel] [PATCH arm-devs v1 3/6] arm/highbank: Use object_new() rather than cpu_arm_init()
Date: Wed, 27 Nov 2013 10:52:58 +0100 [thread overview]
Message-ID: <5295C0FA.9050109@suse.de> (raw)
In-Reply-To: <CAFEAcA90Zx-pPq5Q0-q0+Kg6ydcZx+mWAX-6RspCRmqg30L27g@mail.gmail.com>
Am 27.11.2013 10:10, schrieb Peter Maydell:
> On 27 November 2013 09:02, Peter Crosthwaite
> <peter.crosthwaite@xilinx.com> wrote:
>> To allow the machine model to set device properties before CPU
>> realization.
>>
>> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
>> ---
>>
>> hw/arm/highbank.c | 13 ++++++++++---
>> 1 file changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
>> index fe98ef1..70831ba 100644
>> --- a/hw/arm/highbank.c
>> +++ b/hw/arm/highbank.c
>> @@ -228,11 +228,18 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum cxmachines machine)
>> }
>> }
>>
>> + cpu_model = g_strdup_printf("%s-" TYPE_ARM_CPU, cpu_model);
>> +
>
> Please use cpu_class_by_name() rather than hand-constructing
> the classname. (see also the hw/arm/virt.c code I posted the other
> day, which needs to set a property for other reasons.)
>
>> for (n = 0; n < smp_cpus; n++) {
>> ARMCPU *cpu;
>> - cpu = cpu_arm_init(cpu_model);
>> - if (cpu == NULL) {
>> - fprintf(stderr, "Unable to find CPU definition\n");
>> + Error *err = NULL;
>> +
>> + cpu = ARM_CPU(object_new(cpu_model));
>> + g_free((void *)cpu_model);
>> +
>> + object_property_set_bool(OBJECT(cpu), true, "realized", &err);
>> + if (err) {
>> + fprintf(stderr, "%s\n", error_get_pretty(err));
And use of error_report() (without \n) will be appreciated. :)
Cheers,
Andreas
>> exit(1);
>> }
>
> thanks
> -- PMM
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-11-27 9:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-27 9:00 [Qemu-devel] [PATCH arm-devs v1 0/6] Fix Support for ARM A9 CBAR Peter Crosthwaite
2013-11-27 9:01 ` [Qemu-devel] [PATCH arm-devs v1 1/6] target-arm: Define and use ARM_FEATURE_CBAR Peter Crosthwaite
2013-11-27 9:01 ` [Qemu-devel] [PATCH arm-devs v1 2/6] target-arm/cpu: Convert reset CBAR to a property Peter Crosthwaite
2013-11-27 9:14 ` Peter Maydell
2013-11-27 9:42 ` Andreas Färber
2013-11-27 10:15 ` Peter Maydell
2013-11-27 10:27 ` Andreas Färber
2013-11-27 10:35 ` Peter Maydell
2013-11-27 11:39 ` Peter Crosthwaite
2013-11-27 11:47 ` Peter Maydell
2013-11-28 1:48 ` Peter Crosthwaite
2013-11-27 13:10 ` Andreas Färber
2013-11-27 9:02 ` [Qemu-devel] [PATCH arm-devs v1 3/6] arm/highbank: Use object_new() rather than cpu_arm_init() Peter Crosthwaite
2013-11-27 9:10 ` Peter Maydell
2013-11-27 9:52 ` Andreas Färber [this message]
2013-11-27 9:02 ` [Qemu-devel] [PATCH arm-devs v1 4/6] arm/highbank: Fix CBAR intialisation Peter Crosthwaite
2013-11-27 9:03 ` [Qemu-devel] [PATCH arm-devs v1 5/6] arm/xilinx_zynq: Use object_new() rather than cpu_arm_init() Peter Crosthwaite
2013-11-27 9:04 ` [Qemu-devel] [PATCH arm-devs v1 6/6] arm/xilinx_zynq: Implement CBAR intialisation Peter Crosthwaite
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=5295C0FA.9050109@suse.de \
--to=afaerber@suse.de \
--cc=mark.langsdorf@calxeda.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.maydell@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.