|
| From: | Paolo Bonzini |
| Subject: | [Qemu-devel] Re: [Patch] Simplify cpu_can_run() |
| Date: | Mon, 12 Apr 2010 09:03:32 +0200 |
| User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3 |
On 04/12/2010 08:24 AM, Jun Koi wrote:
diff --git a/cpus.c b/cpus.c
index 0debe77..4adb66d 100644
--- a/cpus.c
+++ b/cpus.c
@@ -98,9 +98,7 @@ static void do_vm_stop(int reason)
static int cpu_can_run(CPUState *env)
{
- if (env->stop)
- return 0;
- if (env->stopped || !vm_running)
+ if (env->stop || env->stopped || !vm_running)
return 0;
return 1;
}
I left it this way on purpose to help comparison with cpu_has_work.
static int cpu_can_run(CPUState *env)
{
if (env->stop)
return 0;
if (env->stopped || !vm_running)
return 0;
return 1;
}
static int cpu_has_work(CPUState *env)
{
if (env->stop)
return 1;
if (env->stopped || !vm_running)
return 0;
Paolo
| [Prev in Thread] | Current Thread | [Next in Thread] |