[PATCH] Make kvm Sleep if eflag is unset.
The main loop checks whether a sleep is needed (kvm_main_loop_wait).
If there is a need to sleep it polls 10msec for signals and
select input from the devices.
Otherwise it enters guest mode.
In case halt is on and there is pending irq we should also
check if the eflags in set or not.
This fixes spinning on the boot loader when the disk is damanged.
Signed-off-by: Dor Laor <[EMAIL PROTECTED]>
---
qemu/qemu-kvm.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index d857d1c..a0eb43f 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -563,7 +563,8 @@ static int has_work(CPUState *env)
return 0;
if (!(env->hflags & HF_HALTED_MASK))
return 1;
- if (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXIT))
+ if ((env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXIT)) &&
+ (env->eflags & IF_MASK))
return 1;
return 0;
}
--
1.5.2.2
>From 6daaaada124fde03b253161f2a9a647fde6f1a86 Mon Sep 17 00:00:00 2001
From: Dor Laor <[EMAIL PROTECTED]>
Date: Wed, 24 Oct 2007 17:03:44 +0200
Subject: [PATCH] Make kvm Sleep if eflag is unset.
The main loop checks whether a sleep is needed (kvm_main_loop_wait).
If there is a need to sleep it polls 10msec for signals and
select input from the devices.
Otherwise it enters guest mode.
In case halt is on and there is pending irq we should also
check if the eflags in set or not.
This fixes spinning on the boot loader when the disk is damanged.
Signed-off-by: Dor Laor <[EMAIL PROTECTED]>
---
qemu/qemu-kvm.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index d857d1c..a0eb43f 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -563,7 +563,8 @@ static int has_work(CPUState *env)
return 0;
if (!(env->hflags & HF_HALTED_MASK))
return 1;
- if (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXIT))
+ if ((env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXIT)) &&
+ (env->eflags & IF_MASK))
return 1;
return 0;
}
--
1.5.2.2
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel