diff options
author | Chegu Vinod <chegu_vinod@hp.com> | 2013-06-24 03:49:41 -0600 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2013-07-12 19:36:01 +0200 |
commit | 3c02270db980007424d797506301826310ce2db4 (patch) | |
tree | 894c91ae01531ca4c15d7bf6093da2288201ceb0 /include | |
parent | 25ca6a1f5a3ee0a1ae670590877ed14f05e28fba (diff) | |
download | hqemu-3c02270db980007424d797506301826310ce2db4.zip hqemu-3c02270db980007424d797506301826310ce2db4.tar.gz |
Introduce async_run_on_cpu()
Introduce an asynchronous version of run_on_cpu() i.e. the caller
doesn't have to block till the call back routine finishes execution
on the target vcpu.
Signed-off-by: Chegu Vinod <chegu_vinod@hp.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/qemu-common.h | 1 | ||||
-rw-r--r-- | include/qom/cpu.h | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/qemu-common.h b/include/qemu-common.h index f439738..6948bb9 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -293,6 +293,7 @@ struct qemu_work_item { void (*func)(void *data); void *data; int done; + bool free; }; diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 147c256..dfd81a1 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -379,6 +379,16 @@ bool cpu_is_stopped(CPUState *cpu); void run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data); /** + * async_run_on_cpu: + * @cpu: The vCPU to run on. + * @func: The function to be executed. + * @data: Data to pass to the function. + * + * Schedules the function @func for execution on the vCPU @cpu asynchronously. + */ +void async_run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data); + +/** * qemu_for_each_cpu: * @func: The function to be executed. * @data: Data to pass to the function. |