[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name
From: |
Jia Liu |
Subject: |
Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name |
Date: |
Mon, 22 Jul 2013 17:42:00 +0800 |
Hi Andreas and Peter,
On Mon, Jul 22, 2013 at 5:29 PM, Peter Maydell <address@hidden> wrote:
> On 22 July 2013 09:56, Jia Liu <address@hidden> wrote:
>> Fix cpu_model by name, make any and or1200 works both OK.
>>
>> Signed-off-by: Jia Liu <address@hidden>
>> ---
>> target-openrisc/cpu.c | 16 ++++++++++++----
>> 1 file changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/target-openrisc/cpu.c b/target-openrisc/cpu.c
>> index e348df0..6637166 100644
>> --- a/target-openrisc/cpu.c
>> +++ b/target-openrisc/cpu.c
>> @@ -100,11 +100,19 @@ static ObjectClass *openrisc_cpu_class_by_name(const
>> char *cpu_model)
>> typename = g_strdup_printf("%s-" TYPE_OPENRISC_CPU, cpu_model);
>> oc = object_class_by_name(typename);
>> g_free(typename);
>> - if (oc != NULL && (!object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU) ||
>> - object_class_is_abstract(oc))) {
>> - return NULL;
>> +
>> + if (oc != NULL && object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU) !=
>> NULL
>> + && !object_class_is_abstract(oc)) {
>> + return oc;
>> }
>> - return oc;
>> +
>> + oc = object_class_by_name(cpu_model);
>> + if (oc != NULL && object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU) !=
>> NULL
>> + && !object_class_is_abstract(oc)) {
>> + return oc;
>> + }
>> +
>> + return NULL;
>> }
>
> This looks a bit odd. The commit message suggests it's an
> attempt to fix the bug that was fixed by commit 071b3364e --
> is it really needed? Andreas?
commit 071b3364e fix the typename only, but this one make "-cpu any"
"-cpu or1200" "-cpu any-or32-cpu" "-cpu or1200-or32-cpu" working fine.
>
> thanks
> -- PMM
Regards,
Jia
- [Qemu-devel] [PATCH v3 1/4] hw/openrisc: Indent typo, (continued)
- [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Jia Liu, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Peter Maydell, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name,
Jia Liu <=
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Peter Maydell, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Jia Liu, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Jia Liu, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Andreas Färber, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Peter Maydell, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Andreas Färber, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Peter Maydell, 2013/07/22
- Re: [Qemu-devel] -cpu behavior (was: [PATCH v3 4/4] target-openrisc: Fix cpu_model by name), Andreas Färber, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Andreas Färber, 2013/07/22
- Re: [Qemu-devel] [PATCH v3 4/4] target-openrisc: Fix cpu_model by name, Anthony Liguori, 2013/07/22