Patchwork [14/35] kvm: Drop return value of kvm_cpu_exec

login
register
mail settings
Submitter Marcelo Tosatti
Date Jan. 6, 2011, 5:56 p.m.
Message ID <e60806755e2b74a34813c73ec61c33d38d102286.1294336601.git.mtosatti@redhat.com>
Download mbox | patch
Permalink /patch/77771/
State New
Headers show

Comments

Marcelo Tosatti - Jan. 6, 2011, 5:56 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

It is not used, it is not needed, so let's remove it.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
 kvm-all.c  |    6 ++----
 kvm-stub.c |    4 ++--
 kvm.h      |    2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)
Jan Kiszka - Jan. 8, 2011, 1:09 p.m.
Am 06.01.2011 18:56, Marcelo Tosatti wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> It is not used, it is not needed, so let's remove it.
> 

Please do not apply this for now. Digging deeper into execution loop
issues, it turned out that we likely do need the return code to clean up
the kvm mess in cpu_exec.

Jan

> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
> ---
>  kvm-all.c  |    6 ++----
>  kvm-stub.c |    4 ++--
>  kvm.h      |    2 +-
>  3 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/kvm-all.c b/kvm-all.c
> index 2538283..7518f2c 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -850,7 +850,7 @@ void kvm_cpu_synchronize_post_init(CPUState *env)
>      env->kvm_vcpu_dirty = 0;
>  }
>  
> -int kvm_cpu_exec(CPUState *env)
> +void kvm_cpu_exec(CPUState *env)
>  {
>      struct kvm_run *run = env->kvm_run;
>      int ret;
> @@ -943,7 +943,7 @@ int kvm_cpu_exec(CPUState *env)
>  #ifdef KVM_CAP_SET_GUEST_DEBUG
>              if (kvm_arch_debug(&run->debug.arch)) {
>                  env->exception_index = EXCP_DEBUG;
> -                return 0;
> +                return;
>              }
>              /* re-enter, this exception was guest-internal */
>              ret = 1;
> @@ -960,8 +960,6 @@ int kvm_cpu_exec(CPUState *env)
>          env->exit_request = 0;
>          env->exception_index = EXCP_INTERRUPT;
>      }
> -
> -    return ret;
>  }
>  
>  int kvm_ioctl(KVMState *s, int type, ...)
> diff --git a/kvm-stub.c b/kvm-stub.c
> index 5384a4b..352c6a6 100644
> --- a/kvm-stub.c
> +++ b/kvm-stub.c
> @@ -79,9 +79,9 @@ void kvm_cpu_synchronize_post_init(CPUState *env)
>  {
>  }
>  
> -int kvm_cpu_exec(CPUState *env)
> +void kvm_cpu_exec(CPUState *env)
>  {
> -    abort ();
> +    abort();
>  }
>  
>  int kvm_has_sync_mmu(void)
> diff --git a/kvm.h b/kvm.h
> index 60a9b42..51ad56f 100644
> --- a/kvm.h
> +++ b/kvm.h
> @@ -46,7 +46,7 @@ int kvm_has_xcrs(void);
>  #ifdef NEED_CPU_H
>  int kvm_init_vcpu(CPUState *env);
>  
> -int kvm_cpu_exec(CPUState *env);
> +void kvm_cpu_exec(CPUState *env);
>  
>  #if !defined(CONFIG_USER_ONLY)
>  int kvm_log_start(target_phys_addr_t phys_addr, ram_addr_t size);

Patch

diff --git a/kvm-all.c b/kvm-all.c
index 2538283..7518f2c 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -850,7 +850,7 @@  void kvm_cpu_synchronize_post_init(CPUState *env)
     env->kvm_vcpu_dirty = 0;
 }
 
-int kvm_cpu_exec(CPUState *env)
+void kvm_cpu_exec(CPUState *env)
 {
     struct kvm_run *run = env->kvm_run;
     int ret;
@@ -943,7 +943,7 @@  int kvm_cpu_exec(CPUState *env)
 #ifdef KVM_CAP_SET_GUEST_DEBUG
             if (kvm_arch_debug(&run->debug.arch)) {
                 env->exception_index = EXCP_DEBUG;
-                return 0;
+                return;
             }
             /* re-enter, this exception was guest-internal */
             ret = 1;
@@ -960,8 +960,6 @@  int kvm_cpu_exec(CPUState *env)
         env->exit_request = 0;
         env->exception_index = EXCP_INTERRUPT;
     }
-
-    return ret;
 }
 
 int kvm_ioctl(KVMState *s, int type, ...)
diff --git a/kvm-stub.c b/kvm-stub.c
index 5384a4b..352c6a6 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -79,9 +79,9 @@  void kvm_cpu_synchronize_post_init(CPUState *env)
 {
 }
 
-int kvm_cpu_exec(CPUState *env)
+void kvm_cpu_exec(CPUState *env)
 {
-    abort ();
+    abort();
 }
 
 int kvm_has_sync_mmu(void)
diff --git a/kvm.h b/kvm.h
index 60a9b42..51ad56f 100644
--- a/kvm.h
+++ b/kvm.h
@@ -46,7 +46,7 @@  int kvm_has_xcrs(void);
 #ifdef NEED_CPU_H
 int kvm_init_vcpu(CPUState *env);
 
-int kvm_cpu_exec(CPUState *env);
+void kvm_cpu_exec(CPUState *env);
 
 #if !defined(CONFIG_USER_ONLY)
 int kvm_log_start(target_phys_addr_t phys_addr, ram_addr_t size);