From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCRHY-0001oF-8o for qemu-devel@nongnu.org; Tue, 07 Jul 2015 07:43:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCRHV-0001aC-Dx for qemu-devel@nongnu.org; Tue, 07 Jul 2015 07:43:24 -0400 Received: from greensocs.com ([193.104.36.180]:60346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCRHV-0001ZR-2o for qemu-devel@nongnu.org; Tue, 07 Jul 2015 07:43:21 -0400 Message-ID: <559BBB55.3050704@greensocs.com> Date: Tue, 07 Jul 2015 13:43:17 +0200 From: Frederic Konrad MIME-Version: 1.0 References: <1435330053-18733-1-git-send-email-fred.konrad@greensocs.com> <1435330053-18733-2-git-send-email-fred.konrad@greensocs.com> <87si909u4n.fsf@linaro.org> In-Reply-To: <87si909u4n.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH V6 01/18] cpu: make cpu_thread_is_idle public. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QWxleCBCZW5uw6ll?= Cc: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, a.spyridakis@virtualopensystems.com, mark.burton@greensocs.com, agraf@suse.de, qemu-devel@nongnu.org, guillaume.delbergue@greensocs.com, pbonzini@redhat.com, alistair.francis@xilinx.com On 07/07/2015 11:47, Alex Benn=C3=A9e wrote: > fred.konrad@greensocs.com writes: > >> From: KONRAD Frederic > Why are we making this visible? Looking at the tree I can't see it bein= g > used outside the cpus.c. I see the function is modified later for async > work. Is this something we are planing to use later? Thanks for spoting this.. It is probably something we used before I put async_safe_work. Fred > >> Signed-off-by: KONRAD Frederic >> --- >> cpus.c | 2 +- >> include/qom/cpu.h | 11 +++++++++++ >> 2 files changed, 12 insertions(+), 1 deletion(-) >> >> diff --git a/cpus.c b/cpus.c >> index 4f0e54d..2d62a35 100644 >> --- a/cpus.c >> +++ b/cpus.c >> @@ -74,7 +74,7 @@ bool cpu_is_stopped(CPUState *cpu) >> return cpu->stopped || !runstate_is_running(); >> } >> =20 >> -static bool cpu_thread_is_idle(CPUState *cpu) >> +bool cpu_thread_is_idle(CPUState *cpu) >> { >> if (cpu->stop || cpu->queued_work_first) { >> return false; >> diff --git a/include/qom/cpu.h b/include/qom/cpu.h >> index 39f0f19..af3c9e4 100644 >> --- a/include/qom/cpu.h >> +++ b/include/qom/cpu.h >> @@ -514,6 +514,17 @@ void qemu_cpu_kick(CPUState *cpu); >> bool cpu_is_stopped(CPUState *cpu); >> =20 >> /** >> + * cpu_thread_is_idle: >> + * @cpu: The CPU to check. >> + * >> + * Checks whether the CPU thread is idle. >> + * >> + * Returns: %true if the thread is idle; >> + * %false otherwise. >> + */ >> +bool cpu_thread_is_idle(CPUState *cpu); >> + >> +/** >> * run_on_cpu: >> * @cpu: The vCPU to run on. >> * @func: The function to be executed.