[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/12] target-i386: consolidate error propagatio
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 01/12] target-i386: consolidate error propagation in x86_cpu_realizefn() |
Date: |
Wed, 27 Mar 2013 11:21:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
Il 21/03/2013 15:28, Igor Mammedov ha scritto:
> Signed-off-by: Igor Mammedov <address@hidden>
> ---
> target-i386/cpu.c | 17 ++++++++++-------
> 1 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index a0640db..e905bcf 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -2100,9 +2100,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
> **errp)
> X86CPU *cpu = X86_CPU(dev);
> X86CPUClass *xcc = X86_CPU_GET_CLASS(dev);
> CPUX86State *env = &cpu->env;
> -#ifndef CONFIG_USER_ONLY
> Error *local_err = NULL;
> -#endif
>
> if (env->cpuid_7_0_ebx_features && env->cpuid_level < 7) {
> env->cpuid_level = 7;
> @@ -2135,8 +2133,9 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
> **errp)
> #endif
> if (check_cpuid && kvm_check_features_against_host(cpu)
> && enforce_cpuid) {
> - error_setg(errp, "Host's CPU doesn't support requested
> features");
> - return;
> + error_setg(&local_err,
> + "Host's CPU doesn't support requested features");
> + goto out;
> }
> }
>
> @@ -2146,8 +2145,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
> **errp)
> if (cpu->env.cpuid_features & CPUID_APIC || smp_cpus > 1) {
> x86_cpu_apic_init(cpu, &local_err);
> if (local_err != NULL) {
> - error_propagate(errp, local_err);
> - return;
> + goto out;
> }
> }
> #endif
> @@ -2156,7 +2154,12 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
> **errp)
> qemu_init_vcpu(&cpu->env);
> cpu_reset(CPU(cpu));
>
> - xcc->parent_realize(dev, errp);
> + xcc->parent_realize(dev, &local_err);
> +out:
> + if (local_err != NULL) {
> + error_propagate(errp, local_err);
> + return;
> + }
> }
>
> /* Enables contiguous-apic-ID mode, for compatibility */
>
Reviewed-by: Paolo Bonzini <address@hidden>
- [Qemu-devel] [RFC 00/12] target-i386: CPU hot-add with cpu_set QMP command, Igor Mammedov, 2013/03/21
- [Qemu-devel] [PATCH 01/12] target-i386: consolidate error propagation in x86_cpu_realizefn(), Igor Mammedov, 2013/03/21
- Re: [Qemu-devel] [PATCH 01/12] target-i386: consolidate error propagation in x86_cpu_realizefn(),
Paolo Bonzini <=
- [Qemu-devel] [PATCH 03/12] target-i386: split out CPU creation and features parsing into cpu_x86_create(), Igor Mammedov, 2013/03/21
- [Qemu-devel] [PATCH 02/12] target-i386: split APIC creation from initialization in x86_cpu_realizefn(), Igor Mammedov, 2013/03/21
- [Qemu-devel] [PATCH 04/12] target-i386: introduce apic-id property, Igor Mammedov, 2013/03/21
- [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Igor Mammedov, 2013/03/21
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Paolo Bonzini, 2013/03/27
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Igor Mammedov, 2013/03/27
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Andreas Färber, 2013/03/27
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Igor Mammedov, 2013/03/27
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Andreas Färber, 2013/03/27
- Re: [Qemu-devel] [PATCH 05/12] target-i386: push hot-plugged VCPU state to KVM and unstop it, Igor Mammedov, 2013/03/27