From patchwork Tue Mar 15 21:50:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 87118 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3171AB7254 for ; Wed, 16 Mar 2011 09:53:20 +1100 (EST) Received: from localhost ([127.0.0.1]:34359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pzd77-0006TX-CC for incoming@patchwork.ozlabs.org; Tue, 15 Mar 2011 18:53:17 -0400 Received: from [140.186.70.92] (port=35239 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzcLX-0002MI-KU for qemu-devel@nongnu.org; Tue, 15 Mar 2011 18:04:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzcLS-0004xY-K8 for qemu-devel@nongnu.org; Tue, 15 Mar 2011 18:04:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzcLS-0004x2-5Y for qemu-devel@nongnu.org; Tue, 15 Mar 2011 18:04:02 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2FM41Tj008969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Mar 2011 18:04:01 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2FM40mf002588; Tue, 15 Mar 2011 18:04:01 -0400 Received: from amt.cnet (vpn1-5-191.ams2.redhat.com [10.36.5.191]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p2FM3xFM024381; Tue, 15 Mar 2011 18:04:00 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 87F5268A037; Tue, 15 Mar 2011 18:53:17 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p2FLrEBi002165; Tue, 15 Mar 2011 18:53:14 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Tue, 15 Mar 2011 18:50:43 -0300 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 29/35] kvm: Keep KVM_RUN return value in separate variable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka Avoid using 'ret' both for the return value of KVM_RUN as well as the code kvm_cpu_exec is supposed to return. Both have no direct relation. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- kvm-all.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 906521e..be235ec 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -890,7 +890,7 @@ void kvm_cpu_synchronize_post_init(CPUState *env) int kvm_cpu_exec(CPUState *env) { struct kvm_run *run = env->kvm_run; - int ret; + int ret, run_ret; DPRINTF("kvm_cpu_exec()\n"); @@ -920,7 +920,7 @@ int kvm_cpu_exec(CPUState *env) cpu_single_env = NULL; qemu_mutex_unlock_iothread(); - ret = kvm_vcpu_ioctl(env, KVM_RUN, 0); + run_ret = kvm_vcpu_ioctl(env, KVM_RUN, 0); qemu_mutex_lock_iothread(); cpu_single_env = env; @@ -928,14 +928,14 @@ int kvm_cpu_exec(CPUState *env) kvm_flush_coalesced_mmio_buffer(); - if (ret == -EINTR || ret == -EAGAIN) { + if (run_ret == -EINTR || run_ret == -EAGAIN) { DPRINTF("io window exit\n"); ret = 0; break; } - if (ret < 0) { - DPRINTF("kvm run failed %s\n", strerror(-ret)); + if (run_ret < 0) { + DPRINTF("kvm run failed %s\n", strerror(-run_ret)); abort(); }