From patchwork Thu Feb 4 14:46:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 44502 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 291B1B7D46 for ; Fri, 5 Feb 2010 02:01:01 +1100 (EST) Received: from localhost ([127.0.0.1]:34799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd30j-0007y4-TC for incoming@patchwork.ozlabs.org; Thu, 04 Feb 2010 09:48:49 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd2zZ-0007vu-KQ for qemu-devel@nongnu.org; Thu, 04 Feb 2010 09:47:37 -0500 Received: from [199.232.76.173] (port=33531 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd2zY-0007v9-WF for qemu-devel@nongnu.org; Thu, 04 Feb 2010 09:47:37 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd2zX-0002or-Rr for qemu-devel@nongnu.org; Thu, 04 Feb 2010 09:47:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59080) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd2zX-0002on-FG for qemu-devel@nongnu.org; Thu, 04 Feb 2010 09:47:35 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o14ElXka026898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 4 Feb 2010 09:47:34 -0500 Received: from localhost (vpn-233-103.phx2.redhat.com [10.3.233.103]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o14ElWb1011471; Thu, 4 Feb 2010 09:47:33 -0500 From: Amit Shah To: qemu-devel@nongnu.org Date: Thu, 4 Feb 2010 20:16:22 +0530 Message-Id: <1265294782-28112-1-git-send-email-amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Amit Shah Subject: [Qemu-devel] [PATCH] kvm: reduce code duplication in config_iothread 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 We have some duplicated code in the CONFIG_IOTHREAD #ifdef and #else cases. Fix that. Signed-off-by: Amit Shah --- kvm-all.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 15ec38e..a2bd78e 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -901,14 +901,11 @@ void kvm_setup_guest_memory(void *start, size_t size) static void on_vcpu(CPUState *env, void (*func)(void *data), void *data) { #ifdef CONFIG_IOTHREAD - if (env == cpu_single_env) { - func(data); - return; + if (env != cpu_single_env) { + abort(); } - abort(); -#else - func(data); #endif + func(data); } struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env,