From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Amit Shah Date: Thu, 4 Feb 2010 20:16:22 +0530 Message-Id: <1265294782-28112-1-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH] kvm: reduce code duplication in config_iothread List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Amit Shah 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, -- 1.6.2.5