aboutsummaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2018-02-09 20:52:39 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2018-03-06 14:00:59 +0100
commit5a9c973b6cda88acb08d62a696a72d9e2be5807b (patch)
treeaec127bd92609e2a2d535f808f2ce52396463ea2 /cpus.c
parent81e963116882eed4ebf7cf3df5c2e1abaab3a288 (diff)
cpus: CPU threads are always created initially for one CPU only
It can never happen for single-threaded TCG that we have more than one CPU in the list, while the first one has not been marked as "created". Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180209195239.16048-4-david@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/cpus.c b/cpus.c
index bcfc0a4bf4..9bcff7d63c 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1383,11 +1383,9 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg)
qemu_mutex_lock_iothread();
qemu_thread_get_self(cpu->thread);
- CPU_FOREACH(cpu) {
- cpu->thread_id = qemu_get_thread_id();
- cpu->created = true;
- cpu->can_do_io = 1;
- }
+ cpu->thread_id = qemu_get_thread_id();
+ cpu->created = true;
+ cpu->can_do_io = 1;
qemu_cond_signal(&qemu_cpu_cond);
/* wait for initial kick-off after machine start */