From: Glauber Costa <[EMAIL PROTECTED]>

This patch introduces a "thread_id" variable to CPUState.
It's duty will be to hold the process, or more generally, thread
id of the current executing cpu

Signed-off-by: Glauber Costa <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/qemu/cpu-defs.h b/qemu/cpu-defs.h
index 6979c11..6387a2f 100644
--- a/qemu/cpu-defs.h
+++ b/qemu/cpu-defs.h
@@ -162,6 +162,7 @@ typedef struct CPUTLBEntry {
                                                                         \
     void *next_cpu; /* next CPU sharing TB cache */                     \
     int cpu_index; /* CPU index (informative) */                        \
+    int thread_id;                                                     \
     /* user data */                                                     \
     void *opaque;                                                       \
                                                                         \
diff --git a/qemu/exec.c b/qemu/exec.c
index 960adcd..b82d26d 100644
--- a/qemu/exec.c
+++ b/qemu/exec.c
@@ -340,6 +340,11 @@ void cpu_exec_init(CPUState *env)
     }
     env->cpu_index = cpu_index;
     env->nb_watchpoints = 0;
+#ifdef __WIN32
+    env->thread_id = GetCurrentProcessId();
+#else
+    env->thread_id = getpid();
+#endif
     *penv = env;
 }
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-commits mailing list
kvm-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-commits

Reply via email to