From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKnUx-0000mN-Pi for qemu-devel@nongnu.org; Wed, 27 Mar 2013 06:22:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKnUw-0003Ji-7w for qemu-devel@nongnu.org; Wed, 27 Mar 2013 06:22:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKnUw-0003JW-0I for qemu-devel@nongnu.org; Wed, 27 Mar 2013 06:22:26 -0400 Message-ID: <5152C843.6080708@redhat.com> Date: Wed, 27 Mar 2013 11:21:55 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1363876125-8264-1-git-send-email-imammedo@redhat.com> <1363876125-8264-2-git-send-email-imammedo@redhat.com> In-Reply-To: <1363876125-8264-2-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/12] target-i386: consolidate error propagation in x86_cpu_realizefn() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@us.ibm.com, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, stefano.stabellini@eu.citrix.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, quintela@redhat.com, armbru@redhat.com, blauwirbel@gmail.com, yang.z.zhang@intel.com, alex.williamson@redhat.com, aderumier@odiso.com, kraxel@redhat.com, anthony.perard@citrix.com, lcapitulino@redhat.com, afaerber@suse.de, rth@twiddle.net Il 21/03/2013 15:28, Igor Mammedov ha scritto: > Signed-off-by: Igor Mammedov > --- > 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