summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-05-02 22:23:49 +0200
committerAndreas Färber <afaerber@suse.de>2012-10-31 01:02:39 +0100
commit60e82579c75068cb49af95595aa99d727e657a0a (patch)
tree4ccc33ee8444f12782c5491ffdfc56660d8c5c87 /include
parente9f9d6b16510776ae3d07e91b1cfb4d412701270 (diff)
cpus: Pass CPUState to qemu_cpu_is_self()
Change return type to bool, move to include/qemu/cpu.h and add documentation. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Igor Mammedov <imammedo@redhat.com> [AF: Updated new caller qemu_in_vcpu_thread()]
Diffstat (limited to 'include')
-rw-r--r--include/qemu/cpu.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/qemu/cpu.h b/include/qemu/cpu.h
index ad706a6dbd..7be983d89c 100644
--- a/include/qemu/cpu.h
+++ b/include/qemu/cpu.h
@@ -78,5 +78,15 @@ struct CPUState {
*/
void cpu_reset(CPUState *cpu);
+/**
+ * qemu_cpu_is_self:
+ * @cpu: The vCPU to check against.
+ *
+ * Checks whether the caller is executing on the vCPU thread.
+ *
+ * Returns: %true if called from @cpu's thread, %false otherwise.
+ */
+bool qemu_cpu_is_self(CPUState *cpu);
+
#endif