[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [Qemu-devel] [PATCH qom-cpu for-1.4 08/14] target-unic
From: |
Andreas Färber |
Subject: |
Re: [Qemu-stable] [Qemu-devel] [PATCH qom-cpu for-1.4 08/14] target-unicore32: Detect attempt to instantiate non-CPU type in cpu_init() |
Date: |
Sun, 27 Jan 2013 23:32:58 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 |
Am 23.01.2013 13:07, schrieb Andreas Färber:
> diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
> index 5359538..7ace68c 100644
> --- a/target-unicore32/helper.c
> +++ b/target-unicore32/helper.c
> @@ -29,9 +29,11 @@ CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
> {
> UniCore32CPU *cpu;
> CPUUniCore32State *env;
> + ObjectClass *oc;
> static int inited = 1;
>
> - if (object_class_by_name(cpu_model) == NULL) {
> + oc = cpu_class_by_name(TYPE_UNICORE32_CPU, cpu_model);
> + if (oc == NULL) {
> return NULL;
> }
> cpu = UNICORE32_CPU(object_new(cpu_model));
Should be using object_class_get_name(oc) instead of cpu_model:
diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
index 7ace68c..183b5b3 100644
--- a/target-unicore32/helper.c
+++ b/target-unicore32/helper.c
@@ -36,7 +36,7 @@ CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
if (oc == NULL) {
return NULL;
}
- cpu = UNICORE32_CPU(object_new(cpu_model));
+ cpu = UNICORE32_CPU(object_new(object_class_get_name(oc)));
env = &cpu->env;
if (inited) {
Fixed.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg