From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 11/15] kvm: Rework inner loop of kvm_cpu_exec Date: Fri, 11 Mar 2011 18:34:42 -0300 Message-ID: <20110311213442.GA16222@amt.cnet> References: <481368ec2de108b87df4cd11c2bd870b215e49b5.1299233998.git.jan.kiszka@siemens.com> <20110305160519.GA4387@amt.cnet> <4D727D22.2030700@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org, qemu-devel@nongnu.org To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:6282 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755814Ab1CKVje (ORCPT ); Fri, 11 Mar 2011 16:39:34 -0500 Content-Disposition: inline In-Reply-To: <4D727D22.2030700@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Mar 05, 2011 at 07:12:50PM +0100, Jan Kiszka wrote: > >> @@ -956,7 +956,6 @@ int kvm_cpu_exec(CPUState *env) > >> abort(); > >> } > >> > >> - ret = 0; /* exit loop */ > >> switch (run->exit_reason) { > > > > Better keep ret assignment here so default behaviour is to > > exit loop? EXCP_INTERRUPT. > > There is no real default behavior: in two cases we stay in the loop, in > two others we leave, and the rest obtains ret from a return value. > Moreover, if a new case misses to set ret, the compiler will complain. > > Jan It will not complain because "ret" is used to store return value of KVM_RUN.