summary refs log tree commit diff stats
path: root/cpus.c
diff options
context:
space:
mode:
authorAnthony Liguori <anthony@codemonkey.ws>2013-08-20 09:51:53 -0500
committerAnthony Liguori <anthony@codemonkey.ws>2013-08-20 09:51:53 -0500
commit237e4f92a81696e5359766a7f19a77a9ff1d02e5 (patch)
treeae60a299d73e3f0742bf4238c3c379466510d7ad /cpus.c
parentbc02fb304c6cc0f1dd0809545d226df2d6f5c093 (diff)
parent321bc0b2b27aa2dd64bf12e0e2a0f323a4903ecf (diff)
downloadfocaccia-qemu-237e4f92a81696e5359766a7f19a77a9ff1d02e5.tar.gz
focaccia-qemu-237e4f92a81696e5359766a7f19a77a9ff1d02e5.zip
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
QOM CPUState refactorings / X86CPU

* gdbstub coprocessor register count bugfix
* QOM instance_post_init infrastructure to override dynamic properties
* X86CPU HyperV preparations for CPU subclasses

# gpg: Signature made Fri 16 Aug 2013 11:49:02 AM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Eduardo Habkost (3) and others
# Via Andreas Färber
* afaerber/tags/qom-cpu-for-anthony:
  cpus: Use cpu_is_stopped() efficiently
  target-i386: Move hyperv_* static globals to X86CPU
  qdev: Set globals in instance_post_init function
  qom: Introduce instance_post_init hook
  tests: Unit tests for qdev global properties handling
  gdbstub: Fix gdb_register_coprocessor() register counting
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cpus.c b/cpus.c
index 0f65e763f2..70cc6171e2 100644
--- a/cpus.c
+++ b/cpus.c
@@ -62,12 +62,17 @@
 
 static CPUState *next_cpu;
 
+bool cpu_is_stopped(CPUState *cpu)
+{
+    return cpu->stopped || !runstate_is_running();
+}
+
 static bool cpu_thread_is_idle(CPUState *cpu)
 {
     if (cpu->stop || cpu->queued_work_first) {
         return false;
     }
-    if (cpu->stopped || !runstate_is_running()) {
+    if (cpu_is_stopped(cpu)) {
         return true;
     }
     if (!cpu->halted || qemu_cpu_has_work(cpu) ||
@@ -429,11 +434,6 @@ void cpu_synchronize_all_post_init(void)
     }
 }
 
-bool cpu_is_stopped(CPUState *cpu)
-{
-    return !runstate_is_running() || cpu->stopped;
-}
-
 static int do_vm_stop(RunState state)
 {
     int ret = 0;
@@ -457,7 +457,7 @@ static bool cpu_can_run(CPUState *cpu)
     if (cpu->stop) {
         return false;
     }
-    if (cpu->stopped || !runstate_is_running()) {
+    if (cpu_is_stopped(cpu)) {
         return false;
     }
     return true;