Patchwork [qom-cpu,v2,13/29] cpus: Change cpu_handle_guest_debug() argument to CPUState

login
register
mail settings
Submitter Andreas Färber
Date June 16, 2013, 3:57 p.m.
Message ID <1371398269-6213-14-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/251720/
State New
Headers show

Comments

Andreas Färber - June 16, 2013, 3:57 p.m.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 cpus.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
Richard Henderson - June 17, 2013, 8:17 p.m.
On 06/16/2013 08:57 AM, Andreas Färber wrote:
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  cpus.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~

Patch

diff --git a/cpus.c b/cpus.c
index 44ec34f..1694455 100644
--- a/cpus.c
+++ b/cpus.c
@@ -459,10 +459,8 @@  static bool cpu_can_run(CPUState *cpu)
     return true;
 }
 
-static void cpu_handle_guest_debug(CPUArchState *env)
+static void cpu_handle_guest_debug(CPUState *cpu)
 {
-    CPUState *cpu = ENV_GET_CPU(env);
-
     gdb_set_stop_cpu(cpu);
     qemu_system_debug_request();
     cpu->stopped = true;
@@ -754,7 +752,7 @@  static void *qemu_kvm_cpu_thread_fn(void *arg)
         if (cpu_can_run(cpu)) {
             r = kvm_cpu_exec(cpu);
             if (r == EXCP_DEBUG) {
-                cpu_handle_guest_debug(env);
+                cpu_handle_guest_debug(cpu);
             }
         }
         qemu_kvm_wait_io_event(cpu);
@@ -1172,7 +1170,7 @@  static void tcg_exec_all(void)
         if (cpu_can_run(cpu)) {
             r = tcg_cpu_exec(env);
             if (r == EXCP_DEBUG) {
-                cpu_handle_guest_debug(env);
+                cpu_handle_guest_debug(cpu);
                 break;
             }
         } else if (cpu->stop || cpu->stopped) {