From patchwork Tue Mar 15 11:26:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 86955 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 0C8A3B6F72 for ; Tue, 15 Mar 2011 22:38:20 +1100 (EST) Received: from localhost ([127.0.0.1]:51080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzSZn-0006f8-A8 for incoming@patchwork.ozlabs.org; Tue, 15 Mar 2011 07:38:11 -0400 Received: from [140.186.70.92] (port=35097 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzSOe-0000wi-NZ for qemu-devel@nongnu.org; Tue, 15 Mar 2011 07:26:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzSOd-0004CO-K5 for qemu-devel@nongnu.org; Tue, 15 Mar 2011 07:26:40 -0400 Received: from david.siemens.de ([192.35.17.14]:18204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzSOd-0004BW-81 for qemu-devel@nongnu.org; Tue, 15 Mar 2011 07:26:39 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.13.6/8.13.6) with ESMTP id p2FBQcVW010945; Tue, 15 Mar 2011 12:26:38 +0100 Received: from mchn199C.mchp.siemens.de ([146.254.215.103]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p2FBQVg8000888; Tue, 15 Mar 2011 12:26:38 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Tue, 15 Mar 2011 12:26:25 +0100 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.14 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH v2 14/20] 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 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 --- kvm-all.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 982e5cc..99abe82 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -901,7 +901,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"); @@ -931,7 +931,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; @@ -939,14 +939,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(); }