[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/10] cpus: remove tcg_halt_cond global variabl
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 02/10] cpus: remove tcg_halt_cond global variable. |
Date: |
Sat, 29 Aug 2015 08:52:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 28/08/2015 16:36, Peter Maydell wrote:
> With this patch, code-wise tcg_halt_cond and tcg_cpu_thread
> are used in pretty much parallel ways (first call into
> qemu_tcg_init_vcpu() sets them up, all the rest just copy
> them into the CPU struct). The only difference is that one
> of them a static at file scope and the other one is a static
> at function scope. It seems a shame to not have them be
> exactly parallel...
Good point, this does the trick:
diff --git a/cpus.c b/cpus.c
index 105b914..054dd68 100644
--- a/cpus.c
+++ b/cpus.c
@@ -786,8 +786,6 @@ static unsigned iothread_requesting_mutex;
static QemuThread io_thread;
-static QemuThread *tcg_cpu_thread;
-
/* cpu creation */
static QemuCond qemu_cpu_cond;
/* system init */
@@ -1222,6 +1220,7 @@ static void qemu_tcg_init_vcpu(CPUState *cpu)
{
char thread_name[VCPU_THREAD_NAME_SIZE];
static QemuCond *tcg_halt_cond;
+ static QemuThread *tcg_cpu_thread;
tcg_cpu_address_space_init(cpu, cpu->as);
Paolo