kvm: reduce code duplication in config_iothread
authorAmit Shah <amit.shah@redhat.com>
Thu, 4 Feb 2010 14:46:22 +0000 (20:16 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 10 Feb 2010 18:45:04 +0000 (12:45 -0600)
We have some duplicated code in the CONFIG_IOTHREAD #ifdef and #else
cases. Fix that.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kvm-all.c

index 684c9c4a6a17ba91a95c58f09948863456d83d9b..79345b2837cec4e3f4fc446b6dce02b3fe18628c 100644 (file)
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -935,14 +935,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,