This involves forcing the CPU into the halted state if qtest is enabled and
replacing the local APIC with the qtest interrupt controller.
It should be pretty straight forward to do the same for other machine types on
other architectures.
Signed-off-by: Anthony Liguori<address@hidden>
---
hw/pc.c | 7 ++++++-
hw/pc_piix.c | 9 ++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index 85304cf..fac5098 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -43,6 +43,7 @@
#include "ui/qemu-spice.h"
#include "memory.h"
#include "exec-memory.h"
+#include "qtest.h"
/* output Bochs bios info messages */
//#define DEBUG_BIOS
@@ -926,7 +927,11 @@ static void pc_cpu_reset(void *opaque)
CPUState *env = opaque;
cpu_reset(env);
- env->halted = !cpu_is_bsp(env);
+ if (qtest_enabled()) {
+ env->halted = 1;
+ } else {
+ env->halted = !cpu_is_bsp(env);
+ }