Patchwork [01/18] Revert "kvm: Drop return value of kvm_cpu_exec"

login
register
mail settings
Submitter Jan Kiszka
Date Jan. 10, 2011, 8:31 a.m.
Message ID <02d452e1836caf612755a8ad0cbfdad900f8cb04.1294648329.git.jan.kiszka@web.de>
Download mbox | patch
Permalink /patch/78099/
State New
Headers show

Comments

Jan Kiszka - Jan. 10, 2011, 8:31 a.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

This reverts commit e60806755e2b74a34813c73ec61c33d38d102286.
---
 kvm-all.c  |    6 ++++--
 kvm-stub.c |    4 ++--
 kvm.h      |    2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

Patch

diff --git a/kvm-all.c b/kvm-all.c
index a5e9246..4ab5f5c 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -817,7 +817,7 @@  void kvm_cpu_synchronize_post_init(CPUState *env)
     env->kvm_vcpu_dirty = 0;
 }
 
-void kvm_cpu_exec(CPUState *env)
+int kvm_cpu_exec(CPUState *env)
 {
     struct kvm_run *run = env->kvm_run;
     int ret;
@@ -906,7 +906,7 @@  void kvm_cpu_exec(CPUState *env)
 #ifdef KVM_CAP_SET_GUEST_DEBUG
             if (kvm_arch_debug(&run->debug.arch)) {
                 env->exception_index = EXCP_DEBUG;
-                return;
+                return 0;
             }
             /* re-enter, this exception was guest-internal */
             ret = 1;
@@ -928,6 +928,8 @@  void kvm_cpu_exec(CPUState *env)
         env->exit_request = 0;
         env->exception_index = EXCP_INTERRUPT;
     }
+
+    return ret;
 }
 
 int kvm_ioctl(int type, ...)
diff --git a/kvm-stub.c b/kvm-stub.c
index e00d7df..1fcfc1e 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -79,9 +79,9 @@  void kvm_cpu_synchronize_post_init(CPUState *env)
 {
 }
 
-void kvm_cpu_exec(CPUState *env)
+int kvm_cpu_exec(CPUState *env)
 {
-    abort();
+    abort ();
 }
 
 int kvm_has_sync_mmu(void)
diff --git a/kvm.h b/kvm.h
index 153d7b9..7bf9cc8 100644
--- a/kvm.h
+++ b/kvm.h
@@ -54,7 +54,7 @@  int kvm_has_xcrs(void);
 #ifdef NEED_CPU_H
 int kvm_init_vcpu(CPUState *env);
 
-void kvm_cpu_exec(CPUState *env);
+int kvm_cpu_exec(CPUState *env);
 
 #if !defined(CONFIG_USER_ONLY)
 int kvm_log_start(target_phys_addr_t phys_addr, ram_addr_t size);