From patchwork Thu Feb 4 14:46:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: kvm: reduce code duplication in config_iothread X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 44502 Message-Id: <1265294782-28112-1-git-send-email-amit.shah@redhat.com> To: qemu-devel@nongnu.org Cc: Amit Shah Date: Thu, 4 Feb 2010 20:16:22 +0530 From: Amit Shah List-Id: qemu-devel.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,