[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 03/22] target-i386: if x86_cpu_realize() failed
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH 03/22] target-i386: if x86_cpu_realize() failed report error and do cleanup |
Date: |
Thu, 13 Sep 2012 11:41:10 -0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Sep 07, 2012 at 10:54:52PM +0200, Igor Mammedov wrote:
> Signed-off-by: Igor Mammedov <address@hidden>
> Acked-by: Andreas Färber <address@hidden>
> ---
> target-i386/helper.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/target-i386/helper.c b/target-i386/helper.c
> index 8a5da3d..a0e4c89 100644
> --- a/target-i386/helper.c
> +++ b/target-i386/helper.c
> @@ -1151,6 +1151,7 @@ X86CPU *cpu_x86_init(const char *cpu_model)
> {
> X86CPU *cpu;
> CPUX86State *env;
> + Error *error = NULL;
>
> cpu = X86_CPU(object_new(TYPE_X86_CPU));
> env = &cpu->env;
> @@ -1161,8 +1162,12 @@ X86CPU *cpu_x86_init(const char *cpu_model)
> return NULL;
> }
>
> - x86_cpu_realize(OBJECT(cpu), NULL);
> -
> + x86_cpu_realize(OBJECT(cpu), &error);
> + if (error_is_set(&error)) {
Can't this be just written as "if (error)"?
(Same question as in the previous patch, but as this is new code I would
like to clarify what's the recommended style, before ACKing it)
> + error_free(error);
> + object_delete(OBJECT(cpu));
> + return NULL;
> + }
> return cpu;
> }
>
> --
> 1.7.11.4
>
>
--
Eduardo
- [Qemu-devel] [PATCH 00/22 v2] target-i386: convert CPU features into properties, Igor Mammedov, 2012/09/07
- [Qemu-devel] [PATCH 01/22] target-i386: return Error from cpu_x86_find_by_name(), Igor Mammedov, 2012/09/07
- [Qemu-devel] [PATCH 02/22] target-i386: cpu_x86_register(): report error from property setter, Igor Mammedov, 2012/09/07
- [Qemu-devel] [PATCH 03/22] target-i386: if x86_cpu_realize() failed report error and do cleanup, Igor Mammedov, 2012/09/07
- Re: [Qemu-devel] [PATCH 03/22] target-i386: if x86_cpu_realize() failed report error and do cleanup,
Eduardo Habkost <=
- [Qemu-devel] [PATCH 04/22] target-i386: filter out not TCG features if running without kvm at realize time, Igor Mammedov, 2012/09/07
- [Qemu-devel] [PATCH 05/22] target-i386: move out CPU features initialization in separate func, Igor Mammedov, 2012/09/07
- [Qemu-devel] [PATCH 07/22] target-i386: convert cpuid features into properties, Igor Mammedov, 2012/09/07
- [Qemu-devel] [PATCH 08/22] target-i386: add stubs for hyperv_(vapic_recommended|relaxed_timing_enabled|get_spinlock_retries)(), Igor Mammedov, 2012/09/07
- [Qemu-devel] [PATCH 10/22] target-i386: convert 'hv_relaxed' feature into property, Igor Mammedov, 2012/09/07
- [Qemu-devel] [PATCH 12/22] target-i386: convert 'check' and 'enforce' features into properties, Igor Mammedov, 2012/09/07
- [Qemu-devel] [PATCH 06/22] target-i386: xlevel should be more than 0x80000000, move fixup into setter, Igor Mammedov, 2012/09/07
- [Qemu-devel] [PATCH 17/22] target-i386: replace uint32_t vendor fields by vendor string in x86_def_t, Igor Mammedov, 2012/09/07