port qemu-kvm's on_vcpu code

run_on_cpu allows to execute work on a given CPUState context.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
diff --git a/cpu-defs.h b/cpu-defs.h
index 0140596..c764d67 100644
--- a/cpu-defs.h
+++ b/cpu-defs.h
@@ -132,6 +132,7 @@
 
 struct kvm_run;
 struct KVMState;
+struct qemu_work_item;
 
 typedef struct CPUBreakpoint {
     target_ulong pc;
@@ -204,6 +205,7 @@
     uint32_t created;                                                   \
     struct QemuThread *thread;                                          \
     struct QemuCond *halt_cond;                                         \
+    struct qemu_work_item *queued_work_first, *queued_work_last;        \
     const char *cpu_model_str;                                          \
     struct KVMState *kvm_state;                                         \
     struct kvm_run *kvm_run;                                            \